MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / DebugCharArray

Function DebugCharArray

src/base/strings.h:90–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90static 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
108static inline std::string DebugString(const std::string& src) {
109 size_t src_len = src.size();

Callers

nothing calls this directly

Calls 2

IsVisibleFunction · 0.85
ToHexFunction · 0.85

Tested by

no test coverage detected