Fawkes API
Fawkes Development Version
|
Container to return array via REST. More...
#include <rest_array.h>
Public Member Functions | |
WebviewRestArray () | |
Empty array constructor. More... | |
WebviewRestArray (std::vector< M > &items) | |
Constructor. More... | |
WebviewRestArray (std::vector< M > &&items) | |
Constructor. More... | |
std::string | to_json (bool pretty=false) const |
Render object to JSON. More... | |
void | from_json (const std::string &json) |
Retrieve data from JSON string. More... | |
void | validate (bool subcall=false) |
Validate if all required fields have been set. More... | |
std::vector< M > & | items () |
Accessor for items. More... | |
void | push_back (M &m) |
Add item at the back of the container. More... | |
void | push_back (M &&m) |
Add item at the back of the container. More... | |
Container to return array via REST.
Definition at line 35 of file rest_array.h.
|
inline |
Empty array constructor.
Definition at line 39 of file rest_array.h.
|
inline |
|
inline |
Constructor.
items | vector of values to move to this array. |
Definition at line 52 of file rest_array.h.
|
inline |
Retrieve data from JSON string.
json | JSON representation suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 80 of file rest_array.h.
|
inline |
|
inline |
Add item at the back of the container.
m | element to move |
Definition at line 132 of file rest_array.h.
|
inline |
Add item at the back of the container.
m | element to copy |
Definition at line 123 of file rest_array.h.
Referenced by BackendInfoRestApi::init().
|
inline |
Render object to JSON.
pretty | true to enable pretty printing (readable spacing) |
Definition at line 61 of file rest_array.h.
|
inline |
Validate if all required fields have been set.
subcall | true if this is called from another class, e.g., a sub-class or array holder. Will modify the kind of exception thrown. |
std::vector<std::string> | thrown if required information is missing and subcall is set to true. Contains a list of missing fields. |
std::runtime_error | informative message describing the missing fields |
Definition at line 103 of file rest_array.h.