![]() |
HoviTron Video Pipeline
|
Public Types | |
enum class | Type { number , string , array , object , boolean , null } |
Public Member Functions | |
void | setOverrides (Node overrides) |
Type | type () const |
Node | optional (std::string const &key) const |
Node | require (std::string const &key) const |
Node | at (std::size_t index) const |
std::size_t | size () const |
double | asDouble () const |
float | asFloat () const |
int | asInt () const |
std::string const & | asString () const |
bool | asBool () const |
operator bool () const | |
Static Public Member Functions | |
static Node | readFrom (std::istream &) |
Definition at line 25 of file JsonParser.h.
|
strong |
Definition at line 28 of file JsonParser.h.
bool json::Node::asBool | ( | ) | const |
Query the value of a boolean
Definition at line 322 of file JsonParser.cpp.
double json::Node::asDouble | ( | ) | const |
Query the value of a number
Definition at line 290 of file JsonParser.cpp.
float json::Node::asFloat | ( | ) | const |
int json::Node::asInt | ( | ) | const |
Query the value of a number and require it to be an integer
Definition at line 303 of file JsonParser.cpp.
std::string const & json::Node::asString | ( | ) | const |
Query the value of a string
Definition at line 314 of file JsonParser.cpp.
Node json::Node::at | ( | std::size_t | index | ) | const |
Query an array by index
Definition at line 269 of file JsonParser.cpp.
json::Node::operator bool | ( | ) | const |
Anything apart from false and null is true
Definition at line 330 of file JsonParser.cpp.
Node json::Node::optional | ( | std::string const & | key | ) | const |
Query an object parameter, Null if not found
It is possible to specify overrides
Definition at line 238 of file JsonParser.cpp.
|
static |
Read JSON from an input stream
Definition at line 203 of file JsonParser.cpp.
Node json::Node::require | ( | std::string const & | key | ) | const |
Query an object parameter, throws "parameter KEY is required" unless found
It is possible to specify overrides
Definition at line 259 of file JsonParser.cpp.
void json::Node::setOverrides | ( | Node | overrides | ) |
Definition at line 227 of file JsonParser.cpp.
std::size_t json::Node::size | ( | ) | const |
Query the size of an array
Definition at line 277 of file JsonParser.cpp.
Node::Type json::Node::type | ( | ) | const |
Query the value type of this node
Definition at line 233 of file JsonParser.cpp.