diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2019-10-04 10:13:35 +0000 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2019-10-04 10:13:35 +0000 |
commit | 765fa925865bcf8a359d55b7c2ccb3913b4805c8 (patch) | |
tree | 81cc22424cbc7a16280c629306e150b2b3be753e /zenXml/zenxml | |
parent | Merge branch '10.15' into 'master' (diff) | |
parent | update bugs.txt after re-release from upstream (diff) | |
download | FreeFileSync-765fa925865bcf8a359d55b7c2ccb3913b4805c8.tar.gz FreeFileSync-765fa925865bcf8a359d55b7c2ccb3913b4805c8.tar.bz2 FreeFileSync-765fa925865bcf8a359d55b7c2ccb3913b4805c8.zip |
Merge branch '10.16' into 'master'10.16
add upstream 10.16
See merge request opensource-tracking/FreeFileSync!13
Diffstat (limited to 'zenXml/zenxml')
-rw-r--r-- | zenXml/zenxml/parser.h | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/zenXml/zenxml/parser.h b/zenXml/zenxml/parser.h index f7604ebf..dbf5a8c4 100644 --- a/zenXml/zenxml/parser.h +++ b/zenXml/zenxml/parser.h @@ -79,31 +79,31 @@ std::string normalize(const std::string& str, Predicate pred) //pred: unary func { std::string output; for (const char c : str) - { - if (c == '&') // - output += "&"; - else if (c == '<') //normalization mandatory: https://www.w3.org/TR/xml/#syntax - output += "<"; - else if (c == '>') // - output += ">"; - else if (pred(c)) + switch (c) { - if (c == '\'') - output += "'"; - else if (c == '"') - output += """; - else - { - output += "&#x"; - const auto [high, low] = hexify(c); - output += high; - output += low; - output += ';'; - } + //*INDENT-OFF* + case '&': output += "&"; break; // + case '<': output += "<"; break; //normalization mandatory: https://www.w3.org/TR/xml/#syntax + case '>': output += ">"; break; // + default: + if (pred(c)) + { + if (c == '\'') output += "'"; + else if (c == '"') output += """; + else + { + output += "&#x"; + const auto [high, low] = hexify(c); + output += high; + output += low; + output += ';'; + } + } + else + output += c; + break; + //*INDENT-ON* } - else - output += c; - } return output; } |