| 1 | #ifndef UTILXMLTOOLS_H | 
 
 
 
 
 | 2 | #define UTILXMLTOOLS_H | 
 
 
 
 
 | 3 |  | 
 
 
 
 
 | 4 | // Utilities functions specific used for Xml Tools (not general functions) | 
 
 
 
 
 | 5 |  | 
 
 
 
 
 | 6 | #include "util.h" | 
 
 
 
 
 | 7 | #include "xmlfilter.h" | 
 
 
 
 
 | 8 | #include <pugixml/pugixml.hpp> | 
 
 
 
 
 | 9 |  | 
 
 
 
 
 | 10 | #include <iostream> | 
 
 
 
 
 | 11 |  | 
 
 
 
 
 | 12 | namespace UtilXmlTools{ | 
 
 
 
 
 | 13 |  | 
 
 
 
 
 | 14 | QVector<QString> getAllXmlFilesByWildcard(const QString &wildcard); | 
 
 
 
 
 | 15 | QVector<QString> getAllPatchFilesByWildcard(const QString &wildcard); | 
 
 
 
 
 | 16 | void backupFile(const QString &file, bool verboseEnabled); | 
 
 
 
 
 | 17 | void getAllNamedElements(pugi::xml_node &node, QList<pugi::xml_node> &result, XmlFilter &filters); | 
 
 
 
 
 | 18 | void getAllXpathElements(const QString &xPathExpression, pugi::xml_document &doc, QList<pugi::xml_node> &result); | 
 
 
 
 
 | 19 | void displaySuccessMessage(const int numberOperations, const QString &operation); | 
 
 
 
 
 | 20 | void displayErrorMessage(const QString& operation, const QString &message, bool exitProgram=true); | 
 
 
 
 
 | 21 | void loadXmlFile(const QString &file, pugi::xml_document &document, pugi::xml_node &rootNode, bool backupsEnabled, bool verboseEnabled, const QString &operationForErrorMessage); | 
 
 
 
 
 | 22 | void saveXmlFile(const QString &file, pugi::xml_document &document, const QString &operationForErrorMessage); | 
 
 
 
 
 | 23 | pugi::xml_node getFirstNamedElement(pugi::xml_node &node, XmlFilter &filters); | 
 
 
 
 
 | 24 | pugi::xml_node getFirstXpathElement(const QString &xPathExpression, pugi::xml_document &doc); | 
 
 
 
 
 | 25 | QStringList qStringListFromSpacedString(const QString &mySpacedString); | 
 
 
 
 
 | 26 | QStringList QStringToArgsArray(const QString &args); | 
 
 
 
 
 | 27 | QStringList getAllFilesByWildcard(const QString &wildcard); | 
 
 
 
 
 | 28 | QList<int> qListIntFromSpacedString(const QString &mySpacedString); | 
 
 
 
 
 | 29 | QList<double> qListDoubleFromSpacedString(const QString &mySpacedString); | 
 
 
 
 
 | 30 |  | 
 
 
 
 
 | 31 | } | 
 
 
 
 
 | 32 |  | 
 
 
 
 
 | 33 | #endif // UTILXMLTOOLS_H |