11 |
|
|
12 |
|
QStringList getAllXmlFilesByWildcard(const QString &wildcard); |
13 |
|
QStringList getAllPatchFilesByWildcard(const QString &wildcard); |
14 |
< |
void backupFile(const QString &file); |
14 |
> |
void backupFile(const QString &file, bool verboseEnabled); |
15 |
|
void getAllNamedElements(pugi::xml_node &node, QList<pugi::xml_node> &result, XmlFilter &filters); |
16 |
|
void getAllXpathElements(const QString &xPathExpression, pugi::xml_document &doc, QList<pugi::xml_node> &result); |
17 |
|
void displaySuccessMessage(const int numberOperations, const QString &operation); |
21 |
|
|
22 |
|
//// inline functions |
23 |
|
|
24 |
< |
inline void loadXmlFile(const QString &file, pugi::xml_document &document, pugi::xml_node &rootNode, bool backupsEnabled, const QString &operationForErrorMessage){ |
24 |
> |
inline void loadXmlFile(const QString &file, pugi::xml_document &document, pugi::xml_node &rootNode, bool backupsEnabled, bool verboseEnabled, const QString &operationForErrorMessage){ |
25 |
|
|
26 |
|
pugi::xml_parse_result result = document.load_file(file.toLatin1().constData()); |
27 |
|
rootNode=document.root(); |
28 |
|
|
29 |
|
if(result.status==pugi::status_ok){ |
30 |
< |
std::cout << "File '" << file.toLatin1().constData() << "' loaded with sucess." << std::endl; |
30 |
> |
if(verboseEnabled){ |
31 |
> |
std::cout << "File '" << file.toLatin1().constData() << "' loaded with sucess." << std::endl; |
32 |
> |
} |
33 |
|
} |
34 |
|
else{ |
35 |
|
UtilXmlTools::displayErrorMessage(operationForErrorMessage,"An error ocurred while loading '" +file + "' XML file\n" + result.description()); |
36 |
|
} |
37 |
|
|
38 |
|
if(backupsEnabled){ |
39 |
< |
UtilXmlTools::backupFile(file); // bake a backup of the file. |
39 |
> |
UtilXmlTools::backupFile(file,verboseEnabled); // bake a backup of the file. |
40 |
|
} |
41 |
|
|
42 |
|
} |