ParseResult
Engine/source/persistence/rapidjson/error/error.h
Result of parsing (wraps ParseErrorCode)
Public Types
bool(ParseResult::*
BooleanType )() const
! Unspecified boolean type
Private Attributes
size_t
Public Functions
Default constructor, no error.
ParseResult(ParseErrorCode code, size_t offset)
Constructor to set an error.
Code()
Get the error code.
bool
IsError()
Whether the result is an error.
bool
operator!=(const ParseResult & that)
bool
operator!=(ParseErrorCode code)
bool
operator==(const ParseResult & that)
bool
operator==(ParseErrorCode code)
Set(ParseErrorCode code, size_t offset)
Update error code and offset.
Public Friends
bool
bool
Detailed Description
Result of parsing (wraps ParseErrorCode)
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 Types
typedef bool(ParseResult::* BooleanType )() const
! Unspecified boolean type
Private Attributes
ParseErrorCode code_
size_t offset_
Public Functions
ParseResult()
Default constructor, no error.
ParseResult(ParseErrorCode code, size_t offset)
Constructor to set an error.
_Offset()
Get the error offset, if IsError(), 0 otherwise.
Clear()
Reset error code.
Code()
Get the error code.
IsError()
Whether the result is an error.
operator BooleanType()
Explicit conversion to
bool, returns
true, iff !IsError().
operator!=(const ParseResult & that)
operator!=(ParseErrorCode code)
operator==(const ParseResult & that)
operator==(ParseErrorCode code)
Set(ParseErrorCode code, size_t offset)
Update error code and offset.