MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / PrintAsStringLiteralTo

Function PrintAsStringLiteralTo

tests/gtest/gtest-all.cc:11299–11310  ·  view source on GitHub ↗

Prints a wchar_t c as if it's part of a string literal, escaping it when necessary; returns how c was formatted.

Source from the content-addressed store, hash-verified

11297// Prints a wchar_t c as if it's part of a string literal, escaping it when
11298// necessary; returns how c was formatted.
11299static CharFormat PrintAsStringLiteralTo(wchar_t c, ostream* os) {
11300 switch (c) {
11301 case L'\'':
11302 *os << "'";
11303 return kAsIs;
11304 case L'"':
11305 *os << "\\\"";
11306 return kSpecialEscape;
11307 default:
11308 return PrintAsCharLiteralTo<wchar_t>(c, os);
11309 }
11310}
11311
11312// Prints a char c as if it's part of a string literal, escaping it when
11313// necessary; returns how c was formatted.

Callers 1

PrintCharsAsStringToFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected