MCPcopy Create free account
hub / github.com/Tencent/rapidjson / main

Function main

example/jsonx/jsonx.cpp:189–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187};
188
189int main(int, char*[]) {
190 // Prepare JSON reader and input stream.
191 Reader reader;
192 char readBuffer[65536];
193 FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
194
195 // Prepare JSON writer and output stream.
196 char writeBuffer[65536];
197 FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
198 JsonxWriter<FileWriteStream> writer(os);
199
200 // JSON reader parse from the input stream and let writer generate the output.
201 if (!reader.Parse(is, writer)) {
202 fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
203 return 1;
204 }
205
206 return 0;
207}

Callers

nothing calls this directly

Calls 3

ParseMethod · 0.45
GetErrorOffsetMethod · 0.45
GetParseErrorCodeMethod · 0.45

Tested by

no test coverage detected