| 88 | } |
| 89 | |
| 90 | static inline std::string DebugCharArray(const char* data, uint32_t size) { |
| 91 | std::string dst; |
| 92 | dst.resize(size << 2); |
| 93 | uint32_t j = 0; |
| 94 | for (uint32_t i = 0; i < size; i++) { |
| 95 | uint8_t c = data[i]; |
| 96 | if (IsVisible(c)) { |
| 97 | dst[j++] = c; |
| 98 | } else { |
| 99 | dst[j++] = '\\'; |
| 100 | dst[j++] = 'x'; |
| 101 | dst[j++] = ToHex(c >> 4); |
| 102 | dst[j++] = ToHex(c & 0xF); |
| 103 | } |
| 104 | } |
| 105 | return dst.substr(0, j); |
| 106 | } |
| 107 | |
| 108 | static inline std::string DebugString(const std::string& src) { |
| 109 | size_t src_len = src.size(); |