Result of parsing (wraps ParseErrorCode)
More...
#include <error.h>
Result of parsing (wraps ParseErrorCode)
if (!ok) {
fprintf(
stderr,
"JSON parse error: %s (%u)",
exit(EXIT_FAILURE);
}
- See also
- GenericReader::Parse, GenericDocument::Parse
Definition at line 105 of file error.h.
rapidjson::ParseResult::ParseResult |
( |
| ) |
|
|
inline |
Default constructor, no error.
Definition at line 108 of file error.h.
rapidjson::ParseResult::ParseResult |
( |
ParseErrorCode |
code, |
|
|
size_t |
offset |
|
) |
| |
|
inline |
Constructor to set an error.
Definition at line 110 of file error.h.
void rapidjson::ParseResult::Clear |
( |
| ) |
|
|
inline |
Reset error code.
Definition at line 127 of file error.h.
void Set(ParseErrorCode code, size_t offset=0)
Update error code and offset.
Get the error code.
Definition at line 113 of file error.h.
bool rapidjson::ParseResult::IsError |
( |
| ) |
const |
|
inline |
Whether the result is an error.
Definition at line 120 of file error.h.
size_t rapidjson::ParseResult::Offset |
( |
| ) |
const |
|
inline |
rapidjson::ParseResult::operator bool |
( |
| ) |
const |
|
inline |
Conversion to bool
, returns true
, iff !IsError().
Definition at line 118 of file error.h.
bool IsError() const
Whether the result is an error.
bool rapidjson::ParseResult::operator== |
( |
const ParseResult & |
that | ) |
const |
|
inline |
Definition at line 122 of file error.h.
122 {
return code_ == that.code_; }
void rapidjson::ParseResult::Set |
( |
ParseErrorCode |
code, |
|
|
size_t |
offset = 0 |
|
) |
| |
|
inline |
Update error code and offset.
Definition at line 129 of file error.h.
Definition at line 124 of file error.h.
124 {
return code == err.code_; }
size_t rapidjson::ParseResult::offset_ |
|
private |
The documentation for this struct was generated from the following file: