ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/XmlTools2/trunk/utilxmltools.h
(Generate patch)

Comparing XmlTools2/trunk/utilxmltools.h (file contents):
Revision 920 by s10k, Sun Feb 2 18:50:10 2014 UTC vs.
Revision 923 by s10k, Mon Feb 3 15:42:14 2014 UTC

# Line 11 | Line 11 | namespace UtilXmlTools{
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);
# Line 21 | Line 21 | pugi::xml_node getFirstXpathElement(cons
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)