MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / PrintArray

Function PrintArray

Applications/JSONDump/main.cpp:10–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8void PrintObject(JSONValue& json);
9
10void PrintArray(JSONValue& json){
11 std::cout << "Array[ ";
12 for(auto& v : *json.array){
13 if(v.IsObject()){
14 PrintObject(v);
15 } else if(v.IsArray()){
16 PrintArray(v);
17 } else if(v.isFloatingPoint){
18 std::cout << v.AsFloat();
19 } else if(v.IsString()){
20 std::cout << v.AsString();
21 } else if(v.IsNumber()){
22 std::cout << v.AsSignedNumber();
23 } else if(v.IsBool()){
24 std::cout << (v.AsBool() ? "true" : "false");
25 } else {
26 std::cout << "null";
27 }
28 std::cout << ", ";
29 }
30 std::cout << " ]\n";
31}
32
33void PrintObject(JSONValue& json){
34 std::cout << "Object{ ";

Callers 1

PrintObjectFunction · 0.85

Calls 10

PrintObjectFunction · 0.85
IsObjectMethod · 0.80
IsArrayMethod · 0.80
AsFloatMethod · 0.80
IsStringMethod · 0.80
AsStringMethod · 0.80
IsNumberMethod · 0.80
AsSignedNumberMethod · 0.80
IsBoolMethod · 0.80
AsBoolMethod · 0.80

Tested by

no test coverage detected