MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / main

Function main

examples/print_json.cpp:13–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include <iostream>
12
13int main(int argc, char** argv)
14{
15 rapidjson::StringBuffer buffer;
16 rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
17
18 buffer.Clear();
19 writer.Reset(buffer);
20 FBE::JSON::to_json(writer, test::StructSimple());
21 std::cout << buffer.GetString() << std::endl << std::endl;
22
23 buffer.Clear();
24 writer.Reset(buffer);
25 FBE::JSON::to_json(writer, test::StructOptional());
26 std::cout << buffer.GetString() << std::endl << std::endl;
27
28 buffer.Clear();
29 writer.Reset(buffer);
30 FBE::JSON::to_json(writer, test::StructNested());
31 std::cout << buffer.GetString() << std::endl << std::endl;
32
33 return 0;
34}

Callers

nothing calls this directly

Calls 6

to_jsonFunction · 0.85
StructSimpleClass · 0.50
StructOptionalClass · 0.50
StructNestedClass · 0.50
ClearMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected