MCPcopy Create free account
hub / github.com/apache/trafficserver / WriteChar

Function WriteChar

lib/yamlcpp/src/emitterutils.cpp:382–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380}
381
382bool 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
409bool WriteComment(ostream_wrapper& out, const std::string& str,
410 std::size_t postCommentIndent) {

Callers 1

emitter.cppFile · 0.85

Calls 1

Tested by

no test coverage detected