Result of parsing (wraps ParseErrorCode)
More...
#include <error.h>
|
typedef bool(ParseResult::* | BooleanType) () const |
| ! Unspecified boolean type
|
|
Result of parsing (wraps ParseErrorCode)
if (!ok) {
fprintf(stderr, "JSON parse error: %s (%u)",
exit(EXIT_FAILURE);
}
GenericDocument & Parse(const typename SourceEncoding::Ch *str)
Parse JSON text from a read-only string (with Encoding conversion)
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
RAPIDJSON_NAMESPACE_BEGIN const RAPIDJSON_ERROR_CHARTYPE * GetParseError_En(ParseErrorCode parseErrorCode)
Maps error code of parsing into error message.
ParseErrorCode Code() const
Get the error code.
ParseResult()
Default constructor, no error.
size_t Offset() const
Get the error offset, if IsError(), 0 otherwise.
- See also
- GenericReader::Parse, GenericDocument::Parse
Definition at line 106 of file error.h.
◆ BooleanType
typedef bool(ParseResult::* ParseResult::BooleanType) () const |
! Unspecified boolean type
Definition at line 108 of file error.h.
◆ ParseResult() [1/2]
ParseResult::ParseResult |
( |
| ) |
|
|
inline |
Default constructor, no error.
Definition at line 111 of file error.h.
◆ ParseResult() [2/2]
Constructor to set an error.
Definition at line 113 of file error.h.
◆ Clear()
void ParseResult::Clear |
( |
| ) |
|
|
inline |
Reset error code.
Definition at line 134 of file error.h.
◆ Code()
Get the error code.
Definition at line 116 of file error.h.
◆ IsError()
bool ParseResult::IsError |
( |
| ) |
const |
|
inline |
Whether the result is an error.
Definition at line 123 of file error.h.
◆ Offset()
size_t ParseResult::Offset |
( |
| ) |
const |
|
inline |
◆ operator BooleanType()
Explicit conversion to bool
, returns true
, iff !IsError().
Definition at line 121 of file error.h.
◆ operator!=() [1/2]
◆ operator!=() [2/2]
◆ operator==() [1/2]
◆ operator==() [2/2]
◆ Set()
Update error code and offset.
Definition at line 136 of file error.h.
◆ operator!=
◆ operator==
The documentation for this struct was generated from the following file: