Changeset 935 for XmlTools2/trunk/utilxmltools.cpp
- Timestamp:
- Feb 6, 2014, 2:05:39 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XmlTools2/trunk/utilxmltools.cpp
r923 r935 46 46 if(!QFile::exists(file+".bak")){ 47 47 if(!Util::backupFile(file)){ 48 std::cerr << "Couldn't backup file '" << file.to Latin1().constData() << "'. Aborting." << std::endl;48 std::cerr << "Couldn't backup file '" << file.toUtf8().constData() << "'. Aborting." << std::endl; 49 49 exit(1); 50 50 } … … 52 52 else{ 53 53 if(verboseEnabled){ 54 std::cout << "Backup file '" << file.to Latin1().constData() << "'' already exists. Skipping..." << std::endl;54 std::cout << "Backup file '" << file.toUtf8().constData() << "'' already exists. Skipping..." << std::endl; 55 55 } 56 56 } … … 64 64 try 65 65 { 66 selectedNodes = doc.select_nodes(xPathExpression.to Latin1().constData());66 selectedNodes = doc.select_nodes(xPathExpression.toUtf8().constData()); 67 67 } 68 68 … … 91 91 try 92 92 { 93 selectedNode = doc.select_single_node(xPathExpression.to Latin1().constData());93 selectedNode = doc.select_single_node(xPathExpression.toUtf8().constData()); 94 94 } 95 95 … … 108 108 if ((*currNode).name() == filters.getElementName() && (filters.getParentElementName() == "" || filters.getParentElementName() == (*currNode).parent().name()) 109 109 && (filters.getAttributeName() == "" || 110 Util::toQString((*currNode).attribute(filters.getAttributeName().to Latin1().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 111 112 112 result << *currNode; … … 125 125 if ((*currNode).name() == filters.getElementName() && (filters.getParentElementName() == "" || filters.getParentElementName() == (*currNode).parent().name()) 126 126 && (filters.getAttributeName() == "" || 127 Util::toQString((*currNode).attribute(filters.getAttributeName().to Latin1().constData()).value()) == filters.getAttributeValue()) ){127 Util::toQString((*currNode).attribute(filters.getAttributeName().toUtf8().constData()).value()) == filters.getAttributeValue()) ){ 128 128 return *currNode; 129 129 } … … 142 142 void displaySuccessMessage(const int numberOperations, const QString &operation){ 143 143 std::cout << "------------------------------------------------------------------------" << std::endl; 144 std::cout << numberOperations << " " << operation.to Latin1().constData() << " operation(s) completed with success!" << std::endl;144 std::cout << numberOperations << " " << operation.toUtf8().constData() << " operation(s) completed with success!" << std::endl; 145 145 std::cout << "------------------------------------------------------------------------" << std::endl; 146 146 } … … 148 148 void displayErrorMessage(const QString& operation, const QString &message, bool exitProgram){ 149 149 std::cerr << "************************************************************************" << std::endl; 150 std::cerr << operation.to Latin1().constData() << " operation failed!" << std::endl << std::endl;151 std::cerr << message.to Latin1().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 152 if(exitProgram) std::cerr << "Aborting..." << std::endl; 153 153 std::cerr << "************************************************************************" << std::endl;
Note:
See TracChangeset
for help on using the changeset viewer.