MCPcopy Create free account
hub / github.com/ElementsProject/elements / AppendEscapedStringTo

Function AppendEscapedStringTo

src/leveldb/util/logging.cc:25–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void AppendEscapedStringTo(std::string* str, const Slice& value) {
26 for (size_t i = 0; i < value.size(); i++) {
27 char c = value[i];
28 if (c >= ' ' && c <= '~') {
29 str->push_back(c);
30 } else {
31 char buf[10];
32 snprintf(buf, sizeof(buf), "\\x%02x",
33 static_cast<unsigned int>(c) & 0xff);
34 str->append(buf);
35 }
36 }
37}
38
39std::string NumberToString(uint64_t num) {
40 std::string r;

Callers 4

EscapeStringFunction · 0.85
PutMethod · 0.85
DeleteMethod · 0.85
DumpTableFunction · 0.85

Calls 2

sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected