MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / DocStat

Class DocStat

benchmark/json.h:23–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21#include <string_view>
22
23struct DocStat {
24 size_t objects = 0;
25 size_t arrays = 0;
26 size_t numbers = 0;
27 size_t strings = 0;
28 size_t trues = 0;
29 size_t falses = 0;
30 size_t nulls = 0;
31
32 size_t members = 0;
33 size_t elements = 0;
34 size_t length = 0;
35 size_t depth = 0;
36
37 bool operator==(const DocStat &rhs) const {
38 return this->objects == rhs.objects && this->arrays == rhs.arrays &&
39 this->numbers == rhs.numbers && this->strings == rhs.strings &&
40 this->trues == rhs.trues && this->falses == rhs.falses &&
41 this->nulls == rhs.nulls && this->members == rhs.members &&
42 this->elements == rhs.elements && this->length == rhs.length;
43 }
44 bool operator!=(const DocStat &rhs) const { return !(*this == rhs); }
45 void print() {
46 printf("======== Members ========\n");
47 printf("Objects: %ld\n", objects);
48 printf("Arrays: %ld\n", arrays);
49 printf("Numbers: %ld\n", numbers);
50 printf("Strings: %ld\n", strings);
51 printf("Trues: %ld\n", trues);
52 printf("Falses: %ld\n", falses);
53 printf("NULLs: %ld\n", nulls);
54 printf("members: %ld\n", members);
55 printf("Elements: %ld\n", elements);
56 printf("Length: %ld\n", length);
57 printf("Depth: %ld\n", depth);
58 printf("\n");
59 }
60};
61
62template <typename PR, typename SR>
63class ParseResult {

Callers 4

find_valueMethod · 0.85
GetStatsMethod · 0.85
find_valueMethod · 0.85
GetStatsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected