Depending on the value of a char (or wchar_t), we print it in one of three formats: - as is if it's a printable ASCII (e.g. 'a', '2', ' '), - as a hexadecimal escape sequence (e.g. '\x7F'), or - as a special escape sequence (e.g. '\r', '\n').
| 11229 | // - as a hexadecimal escape sequence (e.g. '\x7F'), or |
| 11230 | // - as a special escape sequence (e.g. '\r', '\n'). |
| 11231 | enum CharFormat { |
| 11232 | kAsIs, |
| 11233 | kHexEscape, |
| 11234 | kSpecialEscape |
| 11235 | }; |
| 11236 | |
| 11237 | // Returns true if c is a printable ASCII character. We test the |
| 11238 | // value of c directly instead of calling isprint(), which is buggy on |
nothing calls this directly
no outgoing calls
no test coverage detected