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

Function main

example/parse_and_serialize.cpp:6–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "sonic/sonic.h"
5
6int main() {
7 std::string json = R"(
8 {
9 "a": 1,
10 "b": 2
11 }
12 )";
13
14 sonic_json::Document doc;
15 doc.Parse(json);
16
17 sonic_json::WriteBuffer wb;
18 doc.Serialize(wb);
19 std::cout << wb.ToString() << std::endl;
20 return 0;
21}
22// g++ -I../include/ -march=haswell --std=c++11 parse_and_serialize.cpp -o
23// parse_and_serialize

Callers

nothing calls this directly

Calls 2

ParseMethod · 0.80
ToStringMethod · 0.80

Tested by

no test coverage detected