diff options
author | B Stack <bgstack15@gmail.com> | 2021-02-02 21:49:34 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2021-02-02 21:49:34 +0000 |
commit | 26b8bd6eb07b78adad36049e03494a2931b231af (patch) | |
tree | 4d7c950512836f473a6a8cbb521c61e800db6584 /zen/json.h | |
parent | Merge branch '11.5' into 'master' (diff) | |
parent | add upstream 11.6 (diff) | |
download | FreeFileSync-26b8bd6eb07b78adad36049e03494a2931b231af.tar.gz FreeFileSync-26b8bd6eb07b78adad36049e03494a2931b231af.tar.bz2 FreeFileSync-26b8bd6eb07b78adad36049e03494a2931b231af.zip |
Merge branch '11.6' into 'master'11.6
add upstream 11.6
See merge request opensource-tracking/FreeFileSync!30
Diffstat (limited to 'zen/json.h')
-rw-r--r-- | zen/json.h | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -95,15 +95,15 @@ namespace json_impl { namespace { -std::string jsonEscape(const std::string& str) +[[nodiscard]] std::string jsonEscape(const std::string& str) { std::string output; for (const char c : str) switch (c) { //*INDENT-OFF* - case '"': output += "\\\""; break; //escaping mandatory case '\\': output += "\\\\"; break; // + case '"': output += "\\\""; break; //escaping mandatory case '\b': output += "\\b"; break; // case '\f': output += "\\f"; break; // @@ -128,7 +128,7 @@ std::string jsonEscape(const std::string& str) } -std::string jsonUnescape(const std::string& str) +[[nodiscard]] std::string jsonUnescape(const std::string& str) { std::string output; std::basic_string<impl::Char16> utf16Buf; @@ -152,7 +152,6 @@ std::string jsonUnescape(const std::string& str) for (auto it = str.begin(); it != str.end(); ++it) { const char c = *it; - if (c == '\\') { ++it; @@ -166,8 +165,8 @@ std::string jsonUnescape(const std::string& str) switch (c2) { //*INDENT-OFF* - case '"': case '\\': + case '"': case '/': writeOut(c2); break; case 'b': writeOut('\b'); break; case 'f': writeOut('\f'); break; |