| 380 | } |
| 381 | |
| 382 | bool WriteChar(ostream_wrapper& out, char ch, StringEscaping::value stringEscapingStyle) { |
| 383 | if (('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')) { |
| 384 | out << ch; |
| 385 | } else if (ch == '\"') { |
| 386 | out << R"("\"")"; |
| 387 | } else if (ch == '\t') { |
| 388 | out << R"("\t")"; |
| 389 | } else if (ch == '\n') { |
| 390 | out << R"("\n")"; |
| 391 | } else if (ch == '\b') { |
| 392 | out << R"("\b")"; |
| 393 | } else if (ch == '\r') { |
| 394 | out << R"("\r")"; |
| 395 | } else if (ch == '\f') { |
| 396 | out << R"("\f")"; |
| 397 | } else if (ch == '\\') { |
| 398 | out << R"("\\")"; |
| 399 | } else if (0x20 <= ch && ch <= 0x7e) { |
| 400 | out << "\"" << ch << "\""; |
| 401 | } else { |
| 402 | out << "\""; |
| 403 | WriteDoubleQuoteEscapeSequence(out, ch, stringEscapingStyle); |
| 404 | out << "\""; |
| 405 | } |
| 406 | return true; |
| 407 | } |
| 408 | |
| 409 | bool WriteComment(ostream_wrapper& out, const std::string& str, |
| 410 | std::size_t postCommentIndent) { |
no test coverage detected