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 106 of file error.h.
◆ BooleanType
typedef bool(ParseResult::* BooleanType) () const |
! Unspecified boolean type
Definition at line 108 of file error.h.
◆ ParseResult() [1/2]
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()
Reset error code.
Definition at line 134 of file error.h.
void Set(ParseErrorCode code, size_t offset=0)
Update error code and offset.
◆ Code()
Get the error code.
Definition at line 116 of file error.h.
◆ IsError()
Whether the result is an error.
Definition at line 123 of file error.h.
◆ Offset()
◆ operator BooleanType()
Explicit conversion to bool
, returns true
, iff !IsError().
Definition at line 121 of file error.h.
bool IsError() const
Whether the result is an error.
◆ operator!=() [1/2]
Definition at line 129 of file error.h.
129 {
return !(*
this == that); }
◆ operator!=() [2/2]
Definition at line 130 of file error.h.
130 {
return !(*
this == code); }
◆ operator==() [1/2]
◆ operator==() [2/2]
◆ Set()
Update error code and offset.
Definition at line 136 of file error.h.
◆ operator!=
Definition at line 131 of file error.h.
131 {
return err != code; }
◆ operator==
◆ code_
◆ offset_
The documentation for this struct was generated from the following file: