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

Function main

example/capitalize/capitalize.cpp:48–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46};
47
48int main(int, char*[]) {
49 // Prepare JSON reader and input stream.
50 Reader reader;
51 char readBuffer[65536];
52 FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
53
54 // Prepare JSON writer and output stream.
55 char writeBuffer[65536];
56 FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
57 Writer<FileWriteStream> writer(os);
58
59 // JSON reader parse from the input stream and let writer generate the output.
60 CapitalizeFilter<Writer<FileWriteStream> > filter(writer);
61 if (!reader.Parse(is, filter)) {
62 fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
63 return 1;
64 }
65
66 return 0;
67}

Callers

nothing calls this directly

Calls 3

ParseMethod · 0.45
GetErrorOffsetMethod · 0.45
GetParseErrorCodeMethod · 0.45

Tested by

no test coverage detected