| 23 |
|
|
| 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()); |
| 26 |
> |
pugi::xml_parse_result result = document.load_file(file.toUtf8().constData()); |
| 27 |
|
rootNode=document.root(); |
| 28 |
|
|
| 29 |
|
if(result.status==pugi::status_ok){ |
| 30 |
|
if(verboseEnabled){ |
| 31 |
< |
std::cout << "File '" << file.toLatin1().constData() << "' loaded with sucess." << std::endl; |
| 31 |
> |
std::cout << "File '" << file.toUtf8().constData() << "' loaded with sucess." << std::endl; |
| 32 |
|
} |
| 33 |
|
} |
| 34 |
|
else{ |
| 42 |
|
} |
| 43 |
|
|
| 44 |
|
inline void saveXmlFile(const QString &file, pugi::xml_document &document, const QString &operationForErrorMessage){ |
| 45 |
< |
if(!document.save_file(file.toLatin1().constData(), "\t", pugi::format_indent | pugi::format_save_file_text | pugi::format_no_escapes)){ // output as the system new lines ending |
| 45 |
> |
if(!document.save_file(file.toUtf8().constData(), "\t", pugi::format_indent | pugi::format_save_file_text | pugi::format_no_escapes)){ // output as the system new lines ending |
| 46 |
|
UtilXmlTools::displayErrorMessage(operationForErrorMessage,"An error ocurred while saving '" + file + "' XML file"); |
| 47 |
|
} |
| 48 |
|
} |