diff options
author | B Stack <bgstack15@gmail.com> | 2019-09-03 20:50:36 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2019-09-03 20:50:36 +0000 |
commit | 89b5c8eb6012b7b4560958ad3c1aa5b187dafc94 (patch) | |
tree | afc54ec004ab863262f5621fbf282c42fdff29cc /zenXml | |
parent | Merge branch '10.14' into 'master' (diff) | |
parent | add upstream 10.15 (diff) | |
download | FreeFileSync-89b5c8eb6012b7b4560958ad3c1aa5b187dafc94.tar.gz FreeFileSync-89b5c8eb6012b7b4560958ad3c1aa5b187dafc94.tar.bz2 FreeFileSync-89b5c8eb6012b7b4560958ad3c1aa5b187dafc94.zip |
Merge branch '10.15' into 'master'10.15
add upstream 10.15
See merge request opensource-tracking/FreeFileSync!12
Diffstat (limited to 'zenXml')
-rw-r--r-- | zenXml/zenxml/parser.h | 10 | ||||
-rw-r--r-- | zenXml/zenxml/xml.h | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/zenXml/zenxml/parser.h b/zenXml/zenxml/parser.h index 70bf6654..f7604ebf 100644 --- a/zenXml/zenxml/parser.h +++ b/zenXml/zenxml/parser.h @@ -82,7 +82,7 @@ std::string normalize(const std::string& str, Predicate pred) //pred: unary func { if (c == '&') // output += "&"; - else if (c == '<') //normalization mandatory: http://www.w3.org/TR/xml/#syntax + else if (c == '<') //normalization mandatory: https://www.w3.org/TR/xml/#syntax output += "<"; else if (c == '>') // output += ">"; @@ -95,9 +95,9 @@ std::string normalize(const std::string& str, Predicate pred) //pred: unary func else { output += "&#x"; - const auto hexDigits = hexify(c); - output += hexDigits.first; - output += hexDigits.second; + const auto [high, low] = hexify(c); + output += high; + output += low; output += ';'; } } @@ -176,7 +176,7 @@ std::string denormalize(const std::string& str) else output += c; //unexpected char! } - else if (c == '\r') //map all end-of-line characters to \n http://www.w3.org/TR/xml/#sec-line-ends + else if (c == '\r') //map all end-of-line characters to \n https://www.w3.org/TR/xml/#sec-line-ends { auto itNext = it + 1; if (itNext != str.end() && *itNext == '\n') diff --git a/zenXml/zenxml/xml.h b/zenXml/zenxml/xml.h index 15d635bd..80b60730 100644 --- a/zenXml/zenxml/xml.h +++ b/zenXml/zenxml/xml.h @@ -368,8 +368,10 @@ public: std::vector<String> getErrorsAs() const { std::vector<String> output; - const auto& elements = log_.ref().elementList(); - std::transform(elements.begin(), elements.end(), std::back_inserter(output), [](const std::string& str) { return utfTo<String>(str); }); + + for (const std::string& str : log_.ref().elementList()) + output.push_back(utfTo<String>(str)); + return output; } |