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

Comparing XmlTools2/trunk/utilxmltools.cpp (file contents):
Revision 923 by s10k, Mon Feb 3 15:42:14 2014 UTC vs.
Revision 935 by s10k, Thu Feb 6 13:05:39 2014 UTC

# Line 45 | Line 45 | QStringList getAllPatchFilesByWildcard(c
45   void backupFile(const QString &file, bool verboseEnabled){
46      if(!QFile::exists(file+".bak")){
47          if(!Util::backupFile(file)){
48 <            std::cerr << "Couldn't backup file '" << file.toLatin1().constData() << "'. Aborting." << std::endl;
48 >            std::cerr << "Couldn't backup file '" << file.toUtf8().constData() << "'. Aborting." << std::endl;
49              exit(1);
50          }
51      }
52      else{
53          if(verboseEnabled){
54 <            std::cout << "Backup file '" << file.toLatin1().constData() << "'' already exists. Skipping..." << std::endl;
54 >            std::cout << "Backup file '" << file.toUtf8().constData() << "'' already exists. Skipping..." << std::endl;
55          }
56      }
57   }
# Line 63 | Line 63 | void getAllXpathElements(const QString &
63  
64      try
65      {
66 <        selectedNodes = doc.select_nodes(xPathExpression.toLatin1().constData());
66 >        selectedNodes = doc.select_nodes(xPathExpression.toUtf8().constData());
67      }
68  
69      catch (const pugi::xpath_exception& e)
# Line 90 | Line 90 | pugi::xml_node getFirstXpathElement(cons
90  
91      try
92      {
93 <        selectedNode = doc.select_single_node(xPathExpression.toLatin1().constData());
93 >        selectedNode = doc.select_single_node(xPathExpression.toUtf8().constData());
94      }
95  
96      catch (const pugi::xpath_exception& e)
# Line 107 | Line 107 | void getAllNamedElements(pugi::xml_node
107  
108          if ((*currNode).name() == filters.getElementName() && (filters.getParentElementName() == "" || filters.getParentElementName() == (*currNode).parent().name())
109                  && (filters.getAttributeName() == "" ||
110 <                    Util::toQString((*currNode).attribute(filters.getAttributeName().toLatin1().constData()).value()) == filters.getAttributeValue()) ){ // Seems node attribute must be converted to qtsring to remove \r\n needs to check in future!
110 >                    Util::toQString((*currNode).attribute(filters.getAttributeName().toUtf8().constData()).value()) == filters.getAttributeValue()) ){ // Seems node attribute must be converted to qtsring to remove \r\n needs to check in future!
111  
112              result << *currNode;
113              continue;
# Line 124 | Line 124 | pugi::xml_node getFirstNamedElement(pugi
124      {
125          if ((*currNode).name() == filters.getElementName() && (filters.getParentElementName() == "" || filters.getParentElementName() == (*currNode).parent().name())
126                  && (filters.getAttributeName() == "" ||
127 <                    Util::toQString((*currNode).attribute(filters.getAttributeName().toLatin1().constData()).value()) == filters.getAttributeValue()) ){
127 >                    Util::toQString((*currNode).attribute(filters.getAttributeName().toUtf8().constData()).value()) == filters.getAttributeValue()) ){
128              return *currNode;
129          }
130  
# Line 141 | Line 141 | pugi::xml_node getFirstNamedElement(pugi
141  
142   void displaySuccessMessage(const int numberOperations, const QString &operation){
143      std::cout << "------------------------------------------------------------------------" << std::endl;
144 <    std::cout << numberOperations << " " << operation.toLatin1().constData() << " operation(s) completed with success!" << std::endl;
144 >    std::cout << numberOperations << " " << operation.toUtf8().constData() << " operation(s) completed with success!" << std::endl;
145      std::cout << "------------------------------------------------------------------------" << std::endl;
146   }
147  
148   void displayErrorMessage(const QString& operation, const QString &message, bool exitProgram){
149      std::cerr << "************************************************************************" << std::endl;
150 <    std::cerr << operation.toLatin1().constData() << " operation failed!" << std::endl << std::endl;
151 <    std::cerr << message.toLatin1().constData() << std::endl << std::endl;
150 >    std::cerr << operation.toUtf8().constData() << " operation failed!" << std::endl << std::endl;
151 >    std::cerr << message.toUtf8().constData() << std::endl << std::endl;
152      if(exitProgram) std::cerr << "Aborting..." << std::endl;
153      std::cerr << "************************************************************************" << std::endl;
154      if(exitProgram) exit(1);

Diff Legend

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