Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MaximInterface
ParseResult Struct Reference
[RapidJSON error handling]
Result of parsing (wraps ParseErrorCode) More...
#include <error.h>
Public Member Functions | |
| ParseResult () | |
| Default constructor, no error. | |
| ParseResult (ParseErrorCode code, size_t offset) | |
| Constructor to set an error. | |
| ParseErrorCode | Code () const |
| Get the error code. | |
| size_t | Offset () const |
| Get the error offset, if IsError(), 0 otherwise. | |
| operator bool () const | |
Conversion to bool, returns true, iff !IsError(). | |
| bool | IsError () const |
| Whether the result is an error. | |
| void | Clear () |
| Reset error code. | |
| void | Set (ParseErrorCode code, size_t offset=0) |
| Update error code and offset. | |
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); }
- See also:
- GenericReader::Parse, GenericDocument::Parse
Definition at line 106 of file error.h.
Constructor & Destructor Documentation
| ParseResult | ( | ) |
| ParseResult | ( | ParseErrorCode | code, |
| size_t | offset | ||
| ) |
Member Function Documentation
| size_t Offset | ( | ) | const |
| operator bool | ( | ) | const |
Generated on Tue Jul 12 2022 12:06:51 by
1.7.2