mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
[clang-tidy] use raw strings for easier readability (#882)
Found with modernize-raw-string-literal Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -366,15 +366,15 @@ bool WriteChar(ostream_wrapper& out, char ch) {
|
|||||||
if (('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')) {
|
if (('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')) {
|
||||||
out << ch;
|
out << ch;
|
||||||
} else if (ch == '\"') {
|
} else if (ch == '\"') {
|
||||||
out << "\"\\\"\"";
|
out << R"("\"")";
|
||||||
} else if (ch == '\t') {
|
} else if (ch == '\t') {
|
||||||
out << "\"\\t\"";
|
out << R"("\t")";
|
||||||
} else if (ch == '\n') {
|
} else if (ch == '\n') {
|
||||||
out << "\"\\n\"";
|
out << R"("\n")";
|
||||||
} else if (ch == '\b') {
|
} else if (ch == '\b') {
|
||||||
out << "\"\\b\"";
|
out << R"("\b")";
|
||||||
} else if (ch == '\\') {
|
} else if (ch == '\\') {
|
||||||
out << "\"\\\\\"";
|
out << R"("\\")";
|
||||||
} else if (0x20 <= ch && ch <= 0x7e) {
|
} else if (0x20 <= ch && ch <= 0x7e) {
|
||||||
out << "\"" << ch << "\"";
|
out << "\"" << ch << "\"";
|
||||||
} else {
|
} else {
|
||||||
|
@@ -105,7 +105,7 @@ std::string Escape(Stream& in) {
|
|||||||
case 'e':
|
case 'e':
|
||||||
return "\x1B";
|
return "\x1B";
|
||||||
case ' ':
|
case ' ':
|
||||||
return "\x20";
|
return R"( )";
|
||||||
case '\"':
|
case '\"':
|
||||||
return "\"";
|
return "\"";
|
||||||
case '\'':
|
case '\'':
|
||||||
|
Reference in New Issue
Block a user