|
Fawkes API
Fawkes Development Version
|
Plugin representation for JSON transfer. More...
#include <Plugin.h>
Public Member Functions | |
| Plugin () | |
| Constructor. More... | |
| Plugin (const std::string &json) | |
| Constructor from JSON. More... | |
| Plugin (const rapidjson::Value &v) | |
| Constructor from JSON. More... | |
| virtual | ~Plugin () |
| Destructor. More... | |
| virtual std::string | to_json (bool pretty=false) const |
| Render object to JSON. More... | |
| virtual void | to_json_value (rapidjson::Document &d, rapidjson::Value &v) const |
| Render object to JSON. More... | |
| virtual void | from_json (const std::string &json) |
| Retrieve data from JSON string. More... | |
| virtual void | from_json_value (const rapidjson::Value &v) |
| Retrieve data from JSON string. More... | |
| virtual void | validate (bool subcall=false) const |
| Validate if all required fields have been set. More... | |
| std::optional< std::string > | kind () const |
| Get kind value. More... | |
| void | set_kind (const std::string &kind) |
| Set kind value. More... | |
| std::optional< std::string > | apiVersion () const |
| Get apiVersion value. More... | |
| void | set_apiVersion (const std::string &apiVersion) |
| Set apiVersion value. More... | |
| std::optional< std::string > | name () const |
| Get name value. More... | |
| void | set_name (const std::string &name) |
| Set name value. More... | |
| std::optional< std::string > | description () const |
| Get description value. More... | |
| void | set_description (const std::string &description) |
| Set description value. More... | |
| std::optional< bool > | is_meta () const |
| Get is_meta value. More... | |
| void | set_is_meta (const bool &is_meta) |
| Set is_meta value. More... | |
| std::vector< std::string > | meta_children () const |
| Get meta_children value. More... | |
| void | set_meta_children (const std::vector< std::string > &meta_children) |
| Set meta_children value. More... | |
| void | addto_meta_children (const std::string &&meta_children) |
| Add element to meta_children array. More... | |
| void | addto_meta_children (const std::string &meta_children) |
| Add element to meta_children array. More... | |
| std::optional< bool > | is_loaded () const |
| Get is_loaded value. More... | |
| void | set_is_loaded (const bool &is_loaded) |
| Set is_loaded value. More... | |
Static Public Member Functions | |
| static std::string | api_version () |
| Get version of implemented API. More... | |
| Plugin::Plugin | ( | ) |
Constructor.
Definition at line 23 of file Plugin.cpp.
| Plugin::Plugin | ( | const std::string & | json | ) |
Constructor from JSON.
| json | JSON string to initialize from |
Definition at line 27 of file Plugin.cpp.
References from_json().
| Plugin::Plugin | ( | const rapidjson::Value & | v | ) |
Constructor from JSON.
| v | RapidJSON value object to initialize from. |
Definition at line 32 of file Plugin.cpp.
References from_json_value().
|
virtual |
Destructor.
Definition at line 37 of file Plugin.cpp.
|
inline |
Add element to meta_children array.
| meta_children | new value |
Definition at line 194 of file Plugin.h.
References meta_children().
|
inline |
Add element to meta_children array.
The move-semantics version (std::move) should be preferred.
| meta_children | new value |
Definition at line 204 of file Plugin.h.
References meta_children().
|
inlinestatic |
|
inline |
Get apiVersion value.
Definition at line 109 of file Plugin.h.
Referenced by set_apiVersion().
|
inline |
Get description value.
Definition at line 143 of file Plugin.h.
Referenced by set_description().
|
virtual |
Retrieve data from JSON string.
| json | JSON representation suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 109 of file Plugin.cpp.
References from_json_value().
Referenced by Plugin().
|
virtual |
Retrieve data from JSON string.
| v | RapidJSON value suitable for this object. Will allow partial assignment and not validate automaticaly. |
Definition at line 118 of file Plugin.cpp.
Referenced by from_json(), and Plugin().
|
inline |
Get is_loaded value.
Definition at line 212 of file Plugin.h.
Referenced by set_is_loaded().
|
inline |
Get is_meta value.
Definition at line 160 of file Plugin.h.
Referenced by set_is_meta().
|
inline |
|
inline |
Get meta_children value.
Definition at line 177 of file Plugin.h.
Referenced by addto_meta_children(), and set_meta_children().
|
inline |
Get name value.
Definition at line 126 of file Plugin.h.
Referenced by set_name().
|
inline |
Set apiVersion value.
| apiVersion | new value |
Definition at line 118 of file Plugin.h.
References apiVersion().
|
inline |
Set description value.
| description | new value |
Definition at line 152 of file Plugin.h.
References description().
|
inline |
Set is_loaded value.
| is_loaded | new value |
Definition at line 221 of file Plugin.h.
References is_loaded().
|
inline |
|
inline |
|
inline |
Set meta_children value.
| meta_children | new value |
Definition at line 186 of file Plugin.h.
References meta_children().
|
inline |
|
virtual |
Render object to JSON.
| pretty | true to enable pretty printing (readable spacing) |
Definition at line 42 of file Plugin.cpp.
References to_json_value().
|
virtual |
Render object to JSON.
| d | RapidJSON document to retrieve allocator from |
| v | RapidJSON value to add data to |
Definition at line 61 of file Plugin.cpp.
Referenced by to_json().
|
virtual |
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 150 of file Plugin.cpp.