26 b &=
phoenix_check(
"checkParseXmlFile", convertedXml, referenceOutputXml);
40 std::vector<PXmlAttr> vecAttr;
41 vecAttr.push_back(attr);
45 std::vector<PXml> vecChild;
46 vecChild.push_back(xmlChild);
64 std::cerr <<
"checkXmlString : cannot parse xml string '"<<inputXml<<
"'" << std::endl;
74 b &=
phoenix_check(
"checkXmlString", convertedXml, referenceOutputXml);
105 int main(
int argc,
char** argv){
106 phoenix_assert(
checkParseXmlFile(
PPath(
"file.xml"),
"<g><b>truc</b><g>titi</g><g>toto</g></g>",
"<root>\n<g>\n<b>\ntruc</b>\n<g>\ntiti</g>\n<g>\ntoto</g>\n</g>\n</root>\n",
false));
107 phoenix_assert(
checkParseXmlFile(
PPath(
"file.svg"),
"some thing to write <b style=\"a very important style\">maybe in bold</b> and some other thing",
"<root>some thing to write <b style=\"a very important style\"\n\t>maybe in bold</b> and some other thing</root>",
true));
109 phoenix_assert(
checkXmlString(
"<g><b>truc</b><g>titi</g><g>toto</g></g>",
"<root>\n<g>\n<b>\ntruc</b>\n<g>\ntiti</g>\n<g>\ntoto</g>\n</g>\n</root>\n",
false));
111 "<root>\n<g>\n<b>\ntruc</b>\n<g2>\ntest</g2>\n<g>\ntiti</g>\n<g>\ntoto</g>\n</g>\n</root>\n",
false));
113 "<root>\n<svg>\n<g>\n<b>\ntruc</b>\n<g2>\ntest</g2>\n<g>\ntiti</g>\n<g>\ntoto</g>\n</g>\n</svg>\n</root>\n",
false));
116 "<root>\n<svg>\n<g id=\"42\">\n<b>\ntruc</b>\n<g2>\ntest</g2>\n<g>\ntiti</g>\n<g>\ntoto</g>\n</g>\n</svg>\n</root>\n",
false));
118 phoenix_assert(
checkXmlString(
"some thing to write <b>maybe in bold</b> and some other thing",
"<root>some thing to write <b>maybe in bold</b> and some other thing</root>",
true));
119 phoenix_assert(
checkXmlString(
"some thing to write <b >maybe in bold</b> and some other thing",
"<root>some thing to write <b>maybe in bold</b> and some other thing</root>",
true));
120 phoenix_assert(
checkXmlString(
"some thing to write <b style=\"a very important style\">maybe in bold</b> and some other thing",
"<root>some thing to write <b style=\"a very important style\"\n\t>maybe in bold</b> and some other thing</root>",
true));
122 phoenix_assert(
checkXmlString(
"<?xml ?><!-- -->some thing to write <b style=\"a very important style\">maybe in bold</b> and some other thing",
"<root>some thing to write <b style=\"a very important style\"\n\t>maybe in bold</b> and some other thing</root>",
true));
Path of a directory or a file.
bool saveFileContent(const PString &content) const
Save a PString in a file.
const PString & getName() const
Get the variable p_name.
void setName(const PString &name)
Set the variable p_name, of type 'PString'.
const PString & getValue() const
Get the variable p_value.
bool getIsText() const
Get the variable p_isText.
void setVecChild(const std ::vector< PXml > &vecChild)
Set the variable p_vecChild, of type 'std ::vector<PXml>'.
void setVecAttr(const std ::vector< PXmlAttr > &vecAttr)
Set the variable p_vecAttr, of type 'std ::vector<PXmlAttr>'.
const std ::vector< PXml > & getVecChild() const
Get the variable p_vecChild.
void setName(const PString &name)
Set the variable p_name, of type 'PString'.
const PString & getName() const
Get the variable p_name.
#define phoenix_assert(isOk)
bool phoenix_check(const std::string &testName, const std::string &val, const std::string &reference)
Check two string.
PXml pxml_eraseVecChild(const PXml &xml, const PString &childName)
Erase the childs of the current xml if it has childName as name.
bool pxml_saveFile(const PPath &fileName, const PXml &xml, bool isSvg)
Save a xml in a file.
PString pxml_baliseStr(const PXml &xml, bool isSvg)
Convert xml in string.
void pxml_setAttr(PXml &xml, const PString &nameAttr, const PString &valueAttr)
Set a value to an attribute.
bool pxml_parserFile(PXml &xml, const PPath &fileName, bool isSvg)
Parse a PXml with a file.
bool pxml_getChildIfExist(PXml &match, const PXml &xml, const PString &childName)
Get the child with given name if exist.
bool pxml_parserContent(PXml &xml, const PString &fileContent, bool isSvg)
Parse a PXml with a file content.
int main(int argc, char **argv)
bool checkParseXmlFile(const PPath &fileName, const PString &inputXml, const PString &referenceOutputXml, bool isSvg)
Check the xml parsing of a file.
void testCreateXml()
Test to create the XML.
void checkXmlAttr()
Check the xml attribute.
bool checkXmlString(const PString &inputXml, const PString &referenceOutputXml, bool isSvg)
Check the xml parsing.