diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:29:28 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:29:28 +0200 |
commit | 75c07011b7c4d06acd7b45dabdcd60ab9d80f385 (patch) | |
tree | 8853c3978dd152ef377e652239448b1352320206 /RealtimeSync/xml_ffs.cpp | |
parent | 5.22 (diff) | |
download | FreeFileSync-75c07011b7c4d06acd7b45dabdcd60ab9d80f385.tar.gz FreeFileSync-75c07011b7c4d06acd7b45dabdcd60ab9d80f385.tar.bz2 FreeFileSync-75c07011b7c4d06acd7b45dabdcd60ab9d80f385.zip |
5.23
Diffstat (limited to 'RealtimeSync/xml_ffs.cpp')
-rw-r--r-- | RealtimeSync/xml_ffs.cpp | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/RealtimeSync/xml_ffs.cpp b/RealtimeSync/xml_ffs.cpp deleted file mode 100644 index 149b0bbe..00000000 --- a/RealtimeSync/xml_ffs.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * -// ************************************************************************** - -#include "xml_ffs.h" -#include "../lib/ffs_paths.h" -#include <zen/zstring.h> -//#include <wx+/string_conv.h> - -//include FreeFileSync xml headers -#include "../lib/process_xml.h" - -using namespace zen; - - -xmlAccess::XmlRealConfig convertBatchToReal(const xmlAccess::XmlBatchConfig& batchCfg, const Zstring& filename) -{ - std::set<Zstring, LessFilename> uniqueFolders; - - //add main folders - uniqueFolders.insert(batchCfg.mainCfg.firstPair.leftDirectory); - uniqueFolders.insert(batchCfg.mainCfg.firstPair.rightDirectory); - - //additional folders - std::for_each(batchCfg.mainCfg.additionalPairs.begin(), batchCfg.mainCfg.additionalPairs.end(), - [&](const FolderPairEnh & fp) - { - uniqueFolders.insert(fp.leftDirectory); - uniqueFolders.insert(fp.rightDirectory); - }); - - uniqueFolders.erase(Zstring()); - - xmlAccess::XmlRealConfig output; - output.directories.assign(uniqueFolders.begin(), uniqueFolders.end()); - output.commandline = Zstr("\"") + zen::getFreeFileSyncLauncher() + Zstr("\" \"") + filename + Zstr("\""); - return output; -} - - -void rts::readRealOrBatchConfig(const Zstring& filename, xmlAccess::XmlRealConfig& config) //throw xmlAccess::FfsXmlError; -{ - if (xmlAccess::getXmlType(filename) != xmlAccess::XML_TYPE_BATCH) - { - xmlAccess::readRealConfig(filename, config); - return; - } - - //convert batch config to RealtimeSync config - xmlAccess::XmlBatchConfig batchCfg; - try - { - xmlAccess::readConfig(filename, batchCfg); //throw xmlAccess::FfsXmlError; - } - catch (const xmlAccess::FfsXmlError& e) - { - if (e.getSeverity() == xmlAccess::FfsXmlError::WARNING) - config = convertBatchToReal(batchCfg, filename); //do work despite parsing errors, then re-throw - - throw; // - } - config = convertBatchToReal(batchCfg, filename); -} - - -int rts::getProgramLanguage() -{ - xmlAccess::XmlGlobalSettings settings; - - try - { - xmlAccess::readConfig(settings); - } - catch (const xmlAccess::FfsXmlError&) {} //user default language if error occurred - - return settings.programLanguage; -} |