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

Function main

example/condense/condense.cpp:14–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12using namespace rapidjson;
13
14int main(int, char*[]) {
15 // Prepare JSON reader and input stream.
16 Reader reader;
17 char readBuffer[65536];
18 FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
19
20 // Prepare JSON writer and output stream.
21 char writeBuffer[65536];
22 FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
23 Writer<FileWriteStream> writer(os);
24
25 // JSON reader parse from the input stream and let writer generate the output.
26 if (!reader.Parse(is, writer)) {
27 fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
28 return 1;
29 }
30
31 return 0;
32}

Callers

nothing calls this directly

Calls 3

ParseMethod · 0.45
GetErrorOffsetMethod · 0.45
GetParseErrorCodeMethod · 0.45

Tested by

no test coverage detected