summaryrefslogtreecommitdiff
path: root/zenXml
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2019-10-04 10:13:35 +0000
committerDaniel Wilhelm <shieldwed@outlook.com>2019-10-04 10:13:35 +0000
commit765fa925865bcf8a359d55b7c2ccb3913b4805c8 (patch)
tree81cc22424cbc7a16280c629306e150b2b3be753e /zenXml
parentMerge branch '10.15' into 'master' (diff)
parentupdate bugs.txt after re-release from upstream (diff)
downloadFreeFileSync-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')
-rw-r--r--zenXml/zenxml/parser.h46
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 += "&amp;";
- else if (c == '<') //normalization mandatory: https://www.w3.org/TR/xml/#syntax
- output += "&lt;";
- else if (c == '>') //
- output += "&gt;";
- else if (pred(c))
+ switch (c)
{
- if (c == '\'')
- output += "&apos;";
- else if (c == '"')
- output += "&quot;";
- else
- {
- output += "&#x";
- const auto [high, low] = hexify(c);
- output += high;
- output += low;
- output += ';';
- }
+ //*INDENT-OFF*
+ case '&': output += "&amp;"; break; //
+ case '<': output += "&lt;"; break; //normalization mandatory: https://www.w3.org/TR/xml/#syntax
+ case '>': output += "&gt;"; break; //
+ default:
+ if (pred(c))
+ {
+ if (c == '\'') output += "&apos;";
+ else if (c == '"') output += "&quot;";
+ 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;
}
bgstack15