| 21 | #include <string_view> |
| 22 | |
| 23 | struct 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 | |
| 62 | template <typename PR, typename SR> |
| 63 | class ParseResult { |
no outgoing calls
no test coverage detected