| 4 | #include "sonic/sonic.h" |
| 5 | |
| 6 | int 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 |