Namespaces | |
| double_storage | |
| integer_storage | |
| internal | |
Classes | |
| class | bounded_allocation |
| class | document |
| class | dynamic_allocation |
| class | literal |
| class | mutable_string_view |
| class | single_allocation |
| class | string |
| class | value |
Enumerations | |
| enum | error { ERROR_NO_ERROR, ERROR_OUT_OF_MEMORY, ERROR_UNEXPECTED_END, ERROR_MISSING_ROOT_ELEMENT, ERROR_BAD_ROOT, ERROR_EXPECTED_COMMA, ERROR_MISSING_OBJECT_KEY, ERROR_EXPECTED_COLON, ERROR_EXPECTED_END_OF_INPUT, ERROR_UNEXPECTED_COMMA, ERROR_EXPECTED_VALUE, ERROR_EXPECTED_NULL, ERROR_EXPECTED_FALSE, ERROR_EXPECTED_TRUE, ERROR_INVALID_NUMBER, ERROR_MISSING_EXPONENT, ERROR_ILLEGAL_CODEPOINT, ERROR_INVALID_UNICODE_ESCAPE, ERROR_UNEXPECTED_END_OF_UTF16, ERROR_EXPECTED_U, ERROR_INVALID_UTF16_TRAIL_SURROGATE, ERROR_UNKNOWN_ESCAPE, ERROR_INVALID_UTF8 } |
| Error code indicating why parse failed. More... | |
| enum | type : uint8_t { TYPE_INTEGER = 0, TYPE_DOUBLE = 1, TYPE_NULL = 2, TYPE_FALSE = 3, TYPE_TRUE = 4, TYPE_STRING = 5, TYPE_ARRAY = 6, TYPE_OBJECT = 7 } |
| Tag indicating a JSON value's type. More... | |
Functions | |
| template<typename AllocationStrategy , typename StringType > | |
| document | parse (const AllocationStrategy &strategy, const StringType &string) |
sajson Public API
| enum sajson::error |
Error code indicating why parse failed.
| enum sajson::type : uint8_t |
| document sajson::parse | ( | const AllocationStrategy & | strategy, |
| const StringType & | string | ||
| ) |
Parses a string of JSON bytes into a document, given an allocation strategy instance. Any kind of string type is valid as long as a mutable_string_view can be constructed from it.
Valid allocation strategies are single_allocation, dynamic_allocation, and bounded_allocation.
A document is returned whether or not the parse succeeds: success state is available by calling document::is_valid().