PhoenixInkscape  2.0.0
Generate multiple png files with svg inkscape files
pxml_utils.h
Go to the documentation of this file.
1 /***************************************
2  Auteur : Pierre Aubert
3  Mail : pierre.aubert@lapp.in2p3.fr
4  Licence : CeCILL-C
5 ****************************************/
6 
7 #ifndef __PXML_UTILS_H__
8 #define __PXML_UTILS_H__
9 
10 #include "PFileParser.h"
11 #include "PXml.h"
12 
14 typedef std::vector<PXml> PVecXml;
16 typedef std::vector<PXmlAttr> PVecXmlAttr;
17 
18 PFileParser pxml_setXmlParser(const PString & fileContent, bool isSvg = false);
19 
20 bool pxml_parserFile(PXml & xml, const PPath & fileName, bool isSvg = false);
21 bool pxml_parserContent(PXml & xml, const PString & fileContent, bool isSvg = false);
22 
23 bool pxml_parserXmlAttribute(PXml & parent, PFileParser & parser);
24 bool pxml_parserXmlContent(PXml & parent, PFileParser & parser, bool isMainBalise = false);
25 
26 bool pxml_getVecChildIfExist(PVecXml & vecMatch, const PXml & xml, const PString & childName);
27 bool pxml_getChildIfExist(PXml & match, const PXml & xml, const PString & childName);
28 
29 PXml * pxml_getChildPtr(PXml & xml, const PString & childName);
30 
31 bool pxml_getAttrIfExist(PXmlAttr & attr, const PXml & xml, const PString & attrName);
32 
33 void pxml_setAttr(PXml & xml, const PString & nameAttr, const PString & valueAttr);
34 
35 PXml pxml_eraseVecChild(const PXml & xml, const PString & childName);
36 
37 bool pxml_saveFile(const PPath & fileName, const PXml & xml, bool isSvg = false);
38 PString pxml_baliseStr(const PXml & xml, bool isSvg = false);
39 PString pxml_vecXmlStr(const PVecXml & vecXml, bool isSvg = false);
40 PString pxml_attrStr(const PXmlAttr & xmlAttr, bool isSvg = false);
41 PString pxml_vecAttrStr(const PVecXmlAttr & vecXmlAttr, bool isSvg);
42 
43 PString pxml_getFullContent(const PXml & xml);
44 
45 #endif
classe qui permet de parser des fichiers texte en renvoyant les tokens les uns après les autres
Definition: PFileParser.h:20
Path of a directory or a file.
Definition: PPath.h:17
Extends the std::string.
Definition: PString.h:16
Attribute from xml.
Definition: PXml.h:30
Class used to parse xml.
Definition: PXml.h:54
bool pxml_parserXmlContent(PXml &parent, PFileParser &parser, bool isMainBalise=false)
Parse the content of an xml balise.
Definition: pxml_utils.cpp:115
PString pxml_attrStr(const PXmlAttr &xmlAttr, bool isSvg=false)
Convert attribute in string.
Definition: pxml_utils.cpp:368
bool pxml_getVecChildIfExist(PVecXml &vecMatch, const PXml &xml, const PString &childName)
Get the vector of childs with given name if exist.
Definition: pxml_utils.cpp:197
PXml pxml_eraseVecChild(const PXml &xml, const PString &childName)
Erase the childs of the current xml if it has childName as name.
Definition: pxml_utils.cpp:288
PFileParser pxml_setXmlParser(const PString &fileContent, bool isSvg=false)
Set the PFileParser for xml.
Definition: pxml_utils.cpp:20
bool pxml_saveFile(const PPath &fileName, const PXml &xml, bool isSvg=false)
Save a xml in a file.
Definition: pxml_utils.cpp:308
bool pxml_getAttrIfExist(PXmlAttr &attr, const PXml &xml, const PString &attrName)
Get the attribute with given name if exist.
Definition: pxml_utils.cpp:251
bool pxml_parserContent(PXml &xml, const PString &fileContent, bool isSvg=false)
Parse a PXml with a file content.
Definition: pxml_utils.cpp:48
PString pxml_vecAttrStr(const PVecXmlAttr &vecXmlAttr, bool isSvg)
Convert attributes in string.
Definition: pxml_utils.cpp:382
bool pxml_parserXmlAttribute(PXml &parent, PFileParser &parser)
Parse the attribute of a xml balise.
Definition: pxml_utils.cpp:79
std::vector< PXmlAttr > PVecXmlAttr
Vector of PXml.
Definition: pxml_utils.h:16
void pxml_setAttr(PXml &xml, const PString &nameAttr, const PString &valueAttr)
Set a value to an attribute.
Definition: pxml_utils.cpp:270
PString pxml_getFullContent(const PXml &xml)
Get the content of the PXml (children or value)
Definition: pxml_utils.cpp:395
PString pxml_vecXmlStr(const PVecXml &vecXml, bool isSvg=false)
Convert a vecto of xml in string.
Definition: pxml_utils.cpp:355
bool pxml_getChildIfExist(PXml &match, const PXml &xml, const PString &childName)
Get the child with given name if exist.
Definition: pxml_utils.cpp:215
PXml * pxml_getChildPtr(PXml &xml, const PString &childName)
Get the child with given name if exist.
Definition: pxml_utils.cpp:234
bool pxml_parserFile(PXml &xml, const PPath &fileName, bool isSvg=false)
Parse a PXml with a file.
Definition: pxml_utils.cpp:38
std::vector< PXml > PVecXml
Vector of PXml.
Definition: pxml_utils.h:14
PString pxml_baliseStr(const PXml &xml, bool isSvg=false)
Convert xml in string.
Definition: pxml_utils.cpp:318