|
MXL : Media eXchange Layer
MXL
|
#include <JsonUtils.hpp>

Public Member Functions | |
| LimitedJsonParseContext (LimitedJsonParseContext const &)=delete | |
| LimitedJsonParseContext (picojson::value *out, JsonLimits const &limits, std::string &error, std::size_t depth) noexcept | |
| Construct a new LimitedJsonParseContext for a value, with given limits. Refuses to parse any contexts that are nested if depth
== limits.maxDepth. | |
| LimitedJsonParseContext & | operator= (LimitedJsonParseContext const &)=delete |
| template<typename Iter> | |
| bool | parse_array_item (picojson::input< Iter > &in, std::size_t index) |
| Parse an array item. Called by picojson. Throws an error if index exceeded the configured maximum container length. | |
| bool | parse_array_start () |
| Start parsing an array. Called by picojson. Throws an error if already nested to the configured limit. | |
| bool | parse_array_stop (std::size_t) |
| template<typename Iter> | |
| bool | parse_object_item (picojson::input< Iter > &in, std::string const &key) |
| bool | parse_object_start () |
| template<typename Iter> | |
| bool | parse_string (picojson::input< Iter > &in) |
| Start parsing a string. Called by picojson, delegates to picojsons internal string parser. | |
| bool | set_bool (bool value) |
| Set the current value to the boolean value value. Called by picojson when parsing. | |
| bool | set_null () |
| Set the current value to null. Called by picojson when parsing. | |
| bool | set_number (double value) |
| Set the current value to a numerical value value. Called by picojson when parsing. | |
Private Member Functions | |
| bool | checkDepth () |
Private Attributes | |
| std::size_t | _depth |
| Number of arrays and objects that enclose the value this context parses. | |
| std::string * | _error |
| JsonLimits const * | _limits |
| picojson::value * | _out |
picojson parse context that builds a value like picojson::default_parse_context and stops when a limit in JsonLimits is exceeded or an object has a duplicate key. The reason is stored in the shared error string.
Definition at line 36 of file JsonUtils.hpp.
|
inlinenoexcept |
Construct a new LimitedJsonParseContext for a value, with given limits. Refuses to parse any contexts that are nested if depth == limits.maxDepth.
Definition at line 42 of file JsonUtils.hpp.
|
delete |
|
inlineprivate |
|
delete |
|
inline |
Parse an array item. Called by picojson. Throws an error if index exceeded the configured maximum container length.
Definition at line 109 of file JsonUtils.hpp.
|
inline |
Start parsing an array. Called by picojson. Throws an error if already nested to the configured limit.
Definition at line 97 of file JsonUtils.hpp.
|
inline |
Stop parsing an array. Called by picojson.
Definition at line 123 of file JsonUtils.hpp.
|
inline |
Parse and item in an object. Called by picojson. Throws an error if there is a duplicate key, of if the number of items in this object already exceeds the limit.
Definition at line 142 of file JsonUtils.hpp.
|
inline |
Start parsing an object. Throws an error if the maximum configured object depth is already reached.
Definition at line 129 of file JsonUtils.hpp.
|
inline |
Start parsing a string. Called by picojson, delegates to picojsons internal string parser.
Definition at line 90 of file JsonUtils.hpp.
|
inline |
Set the current value to the boolean value value. Called by picojson when parsing.
Definition at line 60 of file JsonUtils.hpp.
|
inline |
Set the current value to null. Called by picojson when parsing.
Definition at line 53 of file JsonUtils.hpp.
|
inline |
Set the current value to a numerical value value. Called by picojson when parsing.
Definition at line 76 of file JsonUtils.hpp.
|
private |
Number of arrays and objects that enclose the value this context parses.
Definition at line 178 of file JsonUtils.hpp.
|
private |
Definition at line 176 of file JsonUtils.hpp.
|
private |
Definition at line 175 of file JsonUtils.hpp.
|
private |
Definition at line 174 of file JsonUtils.hpp.