MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / PrintAsStringLiteralTo

Function PrintAsStringLiteralTo

test/common/gtest/gtest.cpp:10031–10042  ·  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

10029// Prints a wchar_t c as if it's part of a string literal, escaping it when
10030// necessary; returns how c was formatted.
10031static CharFormat PrintAsStringLiteralTo(wchar_t c, ostream* os) {
10032 switch (c) {
10033 case L'\'':
10034 *os << "'";
10035 return kAsIs;
10036 case L'"':
10037 *os << "\\\"";
10038 return kSpecialEscape;
10039 default:
10040 return PrintAsCharLiteralTo<wchar_t>(c, os);
10041 }
10042}
10043
10044// Prints a char c as if it's part of a string literal, escaping it when
10045// necessary; returns how c was formatted.

Callers 1

PrintCharsAsStringToFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected