https://jsonlines.org/
| 101 | |
| 102 | // https://jsonlines.org/ |
| 103 | void read_json_lines() |
| 104 | { |
| 105 | std::string data = R"( |
| 106 | ["Name", "Session", "Score", "Completed"] |
| 107 | ["Gilbert", "2013", 24, true] |
| 108 | ["Alexa", "2013", 29, true] |
| 109 | ["May", "2012B", 14, false] |
| 110 | ["Deloise", "2012A", 19, true] |
| 111 | )"; |
| 112 | |
| 113 | std::stringstream is(data); |
| 114 | json_decoder<json> decoder; |
| 115 | json_stream_reader reader(is, decoder); |
| 116 | |
| 117 | while (!reader.eof()) |
| 118 | { |
| 119 | reader.read_next(); |
| 120 | if (!reader.eof()) |
| 121 | { |
| 122 | json j = decoder.get_result(); |
| 123 | std::cout << j << '\n'; |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | void read_with_stateful_allocator() |
| 129 | { |
no test coverage detected