diff options
author | B Stack <bgstack15@gmail.com> | 2019-09-17 08:06:14 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2019-09-17 08:06:14 -0400 |
commit | ca250bf14979d359a82d5baf11ae9587d5605594 (patch) | |
tree | fc3041d022fee1abfc6df2ffd903fd7662b0b0d9 /zenXml/zenxml | |
parent | add upstream 10.15 (diff) | |
download | FreeFileSync-ca250bf14979d359a82d5baf11ae9587d5605594.tar.gz FreeFileSync-ca250bf14979d359a82d5baf11ae9587d5605594.tar.bz2 FreeFileSync-ca250bf14979d359a82d5baf11ae9587d5605594.zip |
add upstream 10.16
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; } |