![]() |
PhoenixPresentation
2.0.0
Set of cmake function to automate presentation generation
|
#include "pxml_utils.h"
Go to the source code of this file.
Macros | |
#define | ALLOWED_ATTRIBUTE_CHAR "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:-" |
List of allowed char as attribute name. More... | |
#define | ALLOWED_BALISE_CHAR "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:?!-" |
List of allowed char as balise name. More... | |
Functions | |
PString | pxml_attrStr (const PXmlAttr &xmlAttr, bool isSvg) |
Convert attribute in string. More... | |
PString | pxml_baliseStr (const PXml &xml, bool isSvg) |
Convert xml in string. More... | |
PXml | pxml_eraseVecChild (const PXml &xml, const PString &childName) |
Erase the childs of the current xml if it has childName as name. More... | |
bool | pxml_getAttrIfExist (PXmlAttr &attr, const PXml &xml, const PString &attrName) |
Get the attribute with given name if exist. More... | |
bool | pxml_getChildIfExist (PXml &match, const PXml &xml, const PString &childName) |
Get the child with given name if exist. More... | |
PXml * | pxml_getChildPtr (PXml &xml, const PString &childName) |
Get the child with given name if exist. More... | |
PString | pxml_getFullContent (const PXml &xml) |
Get the content of the PXml (children or value) More... | |
bool | pxml_getVecChildIfExist (PVecXml &vecMatch, const PXml &xml, const PString &childName) |
Get the vector of childs with given name if exist. More... | |
bool | pxml_isAttributeEnd (PXml &parent, PFileParser &parser) |
Say if it is the end of the attribute definition of the current balise. More... | |
bool | pxml_parserContent (PXml &xml, const PString &fileContent, bool isSvg) |
Parse a PXml with a file content. More... | |
bool | pxml_parserFile (PXml &xml, const PPath &fileName, bool isSvg) |
Parse a PXml with a file. More... | |
bool | pxml_parserXmlAttribute (PXml &parent, PFileParser &parser) |
Parse the attribute of a xml balise. More... | |
bool | pxml_parserXmlContent (PXml &parent, PFileParser &parser, bool isMainBalise) |
Parse the content of an xml balise. More... | |
bool | pxml_saveFile (const PPath &fileName, const PXml &xml, bool isSvg) |
Save a xml in a file. More... | |
void | pxml_setAttr (PXml &xml, const PString &nameAttr, const PString &valueAttr) |
Set a value to an attribute. More... | |
PFileParser | pxml_setXmlParser (const PString &fileContent, bool isSvg) |
Set the PFileParser for xml. More... | |
PString | pxml_vecAttrStr (const PVecXmlAttr &vecXmlAttr, bool isSvg) |
Convert attributes in string. More... | |
PString | pxml_vecXmlStr (const PVecXml &vecXml, bool isSvg) |
Convert a vecto of xml in string. More... | |
#define ALLOWED_ATTRIBUTE_CHAR "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:-" |
List of allowed char as attribute name.
Definition at line 11 of file pxml_utils.cpp.
#define ALLOWED_BALISE_CHAR "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:?!-" |
List of allowed char as balise name.
Definition at line 8 of file pxml_utils.cpp.
Convert attribute in string.
xmlAttr | : xml attribute to be converted into string |
isSvg | : say if the output xml has to be SVG like (with no space between chevron and newline between attribute |
Definition at line 368 of file pxml_utils.cpp.
References PXmlAttr::getName(), and PXmlAttr::getValue().
Referenced by pxml_vecAttrStr().
Convert xml in string.
xml | : xml to be converted into string |
isSvg | : say if the output xml has to be SVG like (with no space between chevron and newline between attribute |
Definition at line 318 of file pxml_utils.cpp.
References PXml::getIsCompact(), PXml::getIsText(), PXml::getName(), PXml::getValue(), PXml::getVecAttr(), PXml::getVecChild(), pxml_vecAttrStr(), and pxml_vecXmlStr().
Referenced by checkParseXmlFile(), checkXmlString(), pxml_saveFile(), pxml_vecXmlStr(), and saveSlides().
Erase the childs of the current xml if it has childName as name.
xml | : current input |
childName | : name of the childs to be erased |
Definition at line 288 of file pxml_utils.cpp.
References PXml::getName(), PXml::getValue(), PXml::getVecAttr(), PXml::getVecChild(), PXml::setName(), PXml::setValue(), and PXml::setVecAttr().
Referenced by processFileSvg(), and testCreateXml().
Get the attribute with given name if exist.
[out] | attr | : vector of matched child |
xml | : xml input | |
attrName | : name of the searched child |
Definition at line 251 of file pxml_utils.cpp.
References PXml::getVecAttr().
Referenced by getInkscapeLabel(), and loadParserSeq().
Get the child with given name if exist.
[out] | match | : matched child |
xml | : xml input | |
childName | : name of the searched child |
Definition at line 215 of file pxml_utils.cpp.
References PXml::getVecChild().
Referenced by checkXmlString(), and processFileSvg().
Get the child with given name if exist.
xml | : xml input |
childName | : name of the searched child |
Definition at line 234 of file pxml_utils.cpp.
References PXml::getVecChild().
Referenced by checkParseSeq(), processFileSvg(), and saveSlides().
Get the content of the PXml (children or value)
xml | : PXml to be used |
Definition at line 395 of file pxml_utils.cpp.
References PXml::getValue(), PXml::getVecChild(), and pxml_vecXmlStr().
Referenced by checkParseSeq(), and loadParserSeq().
Get the vector of childs with given name if exist.
[out] | vecMatch | : vector of matched childs |
xml | : xml input | |
childName | : name of the searched childs |
Definition at line 197 of file pxml_utils.cpp.
References PXml::getVecChild().
Referenced by loadParserSeq(), and processFileSvg().
bool pxml_isAttributeEnd | ( | PXml & | parent, |
PFileParser & | parser | ||
) |
Say if it is the end of the attribute definition of the current balise.
[out] | parent | : xml parent in wich to set the isCompact attribute |
[out] | parser | : parser to be used |
Definition at line 62 of file pxml_utils.cpp.
References PFileParser::isMatch(), and PXml::setIsCompact().
Referenced by pxml_parserXmlAttribute().
Parse a PXml with a file content.
[out] | xml | : PXml to be initialised |
fileContent | : file content | |
isSvg | : true if the parsed file is a svg |
Definition at line 48 of file pxml_utils.cpp.
References pxml_parserXmlContent(), pxml_setXmlParser(), and PXml::setName().
Referenced by checkXmlString(), and pxml_parserFile().
Parse a PXml with a file.
[out] | xml | : PXml to be initialised |
fileName | : name of the intialisation file | |
isSvg | : true if the parsed file is a svg |
Definition at line 38 of file pxml_utils.cpp.
References PPath::loadFileContent(), and pxml_parserContent().
Referenced by checkParseSeq(), checkParseXmlFile(), and processFileSvg().
bool pxml_parserXmlAttribute | ( | PXml & | parent, |
PFileParser & | parser | ||
) |
Parse the attribute of a xml balise.
[out] | parent | : xml parent in wich to put the attribute |
[out] | parser | : parser to be used |
Definition at line 79 of file pxml_utils.cpp.
References ALLOWED_ATTRIBUTE_CHAR, PFileParser::getLocation(), PFileParser::getNextToken(), PFileParser::getStrComposedOf(), PFileParser::getUntilKeyWithoutPatern(), PXml::getVecAttr(), PFileParser::isEndOfFile(), PFileParser::isMatch(), pxml_isAttributeEnd(), PXmlAttr::setName(), PXmlAttr::setValue(), and PFileParser::setWhiteSpace().
Referenced by pxml_parserXmlContent().
bool pxml_parserXmlContent | ( | PXml & | parent, |
PFileParser & | parser, | ||
bool | isMainBalise | ||
) |
Parse the content of an xml balise.
[out] | parent | : xml parent in wich to put the content |
[out] | parser | : parser to be used |
isMainBalise | : true if the parent balise if the main one, false otherwise |
Definition at line 115 of file pxml_utils.cpp.
References ALLOWED_BALISE_CHAR, PXml::getIsCompact(), PFileParser::getLocation(), PXml::getName(), PFileParser::getStrComposedOf(), PFileParser::getUntilKeyWithoutPatern(), PXml::getValue(), PXml::getVecChild(), PFileParser::isEndOfFile(), PFileParser::isMatch(), pxml_parserXmlAttribute(), PXml::setIsText(), PXml::setName(), PFileParser::setSeparator(), PXml::setValue(), and PFileParser::setWhiteSpace().
Referenced by pxml_parserContent().
Save a xml in a file.
fileName | : name of the output file |
xml | : xml to be saved |
isSvg | : say if the output xml has to be SVG like (with no space between chevron and newline between attribute |
Definition at line 308 of file pxml_utils.cpp.
References pxml_baliseStr(), and PPath::saveFileContent().
Referenced by testCreateXml().
Set a value to an attribute.
[out] | xml | : xml to be modified |
nameAttr | : name of the attribute | |
valueAttr | : value of the attribute |
Definition at line 270 of file pxml_utils.cpp.
References PXml::getVecAttr().
Referenced by saveSlides(), and testCreateXml().
PFileParser pxml_setXmlParser | ( | const PString & | fileContent, |
bool | isSvg | ||
) |
Set the PFileParser for xml.
fileContent | : content to be parsed |
isSvg | : true if the parsed file is a svg |
Definition at line 20 of file pxml_utils.cpp.
References PFileParser::setFileContent(), PFileParser::setSeparator(), and PFileParser::setWhiteSpace().
Referenced by pxml_parserContent().
PString pxml_vecAttrStr | ( | const PVecXmlAttr & | vecXmlAttr, |
bool | isSvg | ||
) |
Convert attributes in string.
vecXmlAttr | : xml attributes to be converted into string |
isSvg | : say if the output xml has to be SVG like (with no space between chevron and newline between attribute |
Definition at line 382 of file pxml_utils.cpp.
References pxml_attrStr().
Referenced by pxml_baliseStr().
Convert a vecto of xml in string.
vecXml | : vecor of xml to be converted into string |
isSvg | : say if the output xml has to be SVG like (with no space between chevron and newline between attribute |
Definition at line 355 of file pxml_utils.cpp.
References pxml_baliseStr().
Referenced by pxml_baliseStr(), and pxml_getFullContent().