Go to the source code of this file.
◆ createSequenceAllMatch()
Create a full sequence of string to match totaly.
- Parameters
-
- Returns
- corresponding sequence
Definition at line 63 of file PParseSeq_utils.cpp.
65 for(PVecString::const_iterator it(vecStr.begin()); it != vecStr.end(); ++it){
71 stepBegin.
getVecCmd().push_back(cmdBegin);
void setIsMatch(bool isMatch)
Set the variable p_isMatch, of type 'bool'.
void setStr(const PString &str)
Set the variable p_str, of type 'PString'.
const std ::vector< PParseStep > & getVecStep() const
Get the variable p_vecStep.
Describes a parsing step.
void setIsOptional(bool isOptional)
Set the variable p_isOptional, of type 'bool'.
const std ::vector< PParseCmd > & getVecCmd() const
Get the variable p_vecCmd.
References PParseStep::getVecCmd(), PParseSeq::getVecStep(), PParseCmd::setIsMatch(), PParseStep::setIsOptional(), and PParseCmd::setStr().
Referenced by checkParseSeqFromVec().
◆ loadParserSeq()
Load a ParseSeq with a XML balise.
- Parameters
-
[out] | seq | : ParseSeq to be initialised |
| xmlSeq | : sequence in XML |
- Returns
- true on success, false otherwise Parse a xml such as : <sequence> <step> <str>0123456789</str> </step> <step optional="true"> <match>lu</match> <m>u</m> </step> </sequence> It get a number followed by lu or u or nothing
Definition at line 26 of file PParseSeq_utils.cpp.
27 if(xmlSeq.
getName() !=
"sequence"){
28 std::cerr <<
"loadParserSeq : expect <sequence> balise, not <"<<xmlSeq.
getName()<<
"> balise" << std::endl;
33 for(PVecXml::iterator itStep(listXmlStep.begin()); itStep != listXmlStep.end(); ++itStep){
38 step.
setIsOptional(val ==
"true" || val ==
"True" || val ==
"TRUE");
40 PVecXml & listCmd(itStep->getVecChild());
41 for(PVecXml::iterator itCmd(listCmd.begin()); itCmd != listCmd.end(); ++itCmd){
44 PString cmdName(itCmd->getName());
45 bool isString(cmdName ==
"str" || cmdName ==
"s");
46 bool isMatch(cmdName ==
"match" || cmdName ==
"m");
48 if(isString || isMatch){
const PString & getValue() const
Get the variable p_value.
const PString & getName() const
Get the variable p_name.
bool pxml_getVecChildIfExist(PVecXml &vecMatch, const PXml &xml, const PString &childName)
Get the vector of childs with given name if exist.
bool pxml_getAttrIfExist(PXmlAttr &attr, const PXml &xml, const PString &attrName)
Get the attribute with given name if exist.
PString pxml_getFullContent(const PXml &xml)
Get the content of the PXml (children or value)
std::vector< PXml > PVecXml
Vector of PXml.
References PXml::getName(), PXmlAttr::getValue(), PParseStep::getVecCmd(), PParseSeq::getVecStep(), pxml_getAttrIfExist(), pxml_getFullContent(), pxml_getVecChildIfExist(), PParseCmd::setIsMatch(), PParseStep::setIsOptional(), and PParseCmd::setStr().
Referenced by checkParseSeq().