struct ParseResult

Defined at line 106 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

Result of parsing (wraps ParseErrorCode)

Code

                                    
                                                Document doc;
                                                ParseResult ok = doc.Parse("[42]");
                                                if (!ok) {
                                                    fprintf(stderr, "JSON parse error: %s (%u)",
                                                            GetParseError_En(ok.Code()), ok.Offset());
                                                    exit(EXIT_FAILURE);
                                                }
                                    
                                

Public Methods

void ParseResult ()

Default constructor, no error.

Defined at line 111 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

void ParseResult (ParseErrorCode code, size_t offset)

Constructor to set an error.

Defined at line 113 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

ParseErrorCode Code ()

Get the error code.

Defined at line 116 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

size_t Offset ()

Get the error offset, if

0 otherwise.

Defined at line 118 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

BooleanType operator bool (rapidjson::ParseResult::*)() const ()

Explicit conversion to

returns

iff !

Defined at line 121 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

bool IsError ()

Whether the result is an error.

Defined at line 123 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

bool operator== (const ParseResult & that)

Defined at line 125 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

bool operator== (ParseErrorCode code)

Defined at line 126 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

bool operator!= (const ParseResult & that)

Defined at line 129 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

bool operator!= (ParseErrorCode code)

Defined at line 130 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

void Clear ()

Reset error code.

Defined at line 134 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

void Set (ParseErrorCode code, size_t offset)

Update error code and offset.

Defined at line 136 of file ../../third_party/rapidjson/include/rapidjson/error/error.h

Friends

bool ParseResult (ParseErrorCode code, const ParseResult & err)
bool ParseResult (ParseErrorCode codeconst ParseResult & err)