Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
condense.cpp File Reference
Include dependency graph for condense.cpp:

Go to the source code of this file.

Functions

int main (int, char *[])
 

Function Documentation

◆ main()

int main ( int ,
char * [] )

Definition at line 14 of file condense.cpp.

14 {
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));
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}
File byte stream for input using fread().
Wrapper of C file stream for output using fwrite().
ParseResult Parse(InputStream &is, Handler &handler)
Parse JSON text.
Definition reader.h:557
ParseErrorCode GetParseErrorCode() const
Get the ParseErrorCode of last parsing.
Definition reader.h:683
size_t GetErrorOffset() const
Get the position of last parsing error in input, 0 otherwise.
Definition reader.h:686
JSON writer.
Definition writer.h:89
os_t os
RAPIDJSON_NAMESPACE_BEGIN const RAPIDJSON_ERROR_CHARTYPE * GetParseError_En(ParseErrorCode parseErrorCode)
Maps error code of parsing into error message.
Definition en.h:36
Here is the call graph for this function: