MCPcopy Create free account
hub / github.com/arangodb/velocypack / dump

Method dump

examples/exampleCustom.cpp:26–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 }
25
26 void dump(Slice const& value, Dumper* dumper, Slice const&) override final {
27 Sink* sink = dumper->sink();
28
29 if (value.head() == 0xf0) {
30 sink->append(std::to_string(myMagicNumber));
31 return;
32 }
33 if (value.head() == 0xf4) {
34 char const* start = value.startAs<char const>();
35 // read string length
36 uint8_t length = *(value.start() + 1);
37 // append string (don't care about escaping here...)
38 sink->push_back('"');
39 sink->append(start + 2, static_cast<ValueLength>(length));
40 sink->push_back('"');
41 return;
42 }
43 throw "unknown type!";
44 }
45};
46
47int main(int, char* []) {

Callers 1

mainFunction · 0.45

Calls 5

sinkMethod · 0.80
headMethod · 0.45
appendMethod · 0.45
startMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected