Prints a wchar_t c as if it's part of a string literal, escaping it when necessary; returns how c was formatted.
| 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. |
| 10031 | static 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. |
no outgoing calls
no test coverage detected