|
The JSONObject class is used to represent and (de)serialize JSON objects. More...
#include <ArmarXCore/util/json/JSONObject.h>
Public Member Functions | |
void | append (const armarx::AbstractObjectSerializerPtr &val) override |
std::string | asString (bool pretty=false) const |
armarx::AbstractObjectSerializerPtr | createElement () const override |
void | fromString (const ::std::string &jsonString, const ::Ice::Current &=Ice::emptyCurrent) override |
template<typename T > | |
void | getArray (const std::string &key, std::vector< T > &result) |
bool | getBool (const ::std::string &key) const override |
double | getDouble (const ::std::string &key) const override |
void | getDoubleArray (const ::std::string &key, std::vector< double > &result) override |
armarx::AbstractObjectSerializerPtr | getElement (const ::std::string &key) const override |
armarx::AbstractObjectSerializerPtr | getElement (unsigned int index) const override |
std::vector< std::string > | getElementNames () const override |
armarx::ElementType | getElementType (const ::Ice::Current &=Ice::emptyCurrent) const override |
float | getFloat (const ::std::string &key) const override |
void | getFloatArray (const ::std::string &key, std::vector< float > &result) override |
int | getInt (const ::std::string &key) const override |
void | getIntArray (const ::std::string &key, std::vector< int > &result) override |
const Json::Value & | getJsonValue () const |
std::string | getString (const ::std::string &key) const override |
void | getStringArray (const ::std::string &key, std::vector< std::string > &result) override |
void | getVariantArray (const ::std::string &key, std::vector< armarx::VariantPtr > &result) override |
void | getVariantMap (const ::std::string &key, armarx::StringVariantBaseMap &result) override |
bool | hasElement (const ::std::string &key) const override |
JSONObject (armarx::ElementType nodeType=armarx::ElementTypes::eObject, const Ice::CommunicatorPtr ic=Ice::CommunicatorPtr()) | |
JSONObject (const Ice::CommunicatorPtr ic) | |
JSONObject (const JSONObject &toCopy) | |
void | merge (const armarx::AbstractObjectSerializerPtr &val) override |
void | reset () override |
template<typename T > | |
void | set (const ::std::string &key, T val) |
template<typename T > | |
void | set (int index, T val) |
template<typename T > | |
void | setArray (const ::std::string &key, const std::vector< T > &val) |
void | setBool (const ::std::string &key, bool val) override |
void | setBool (unsigned int index, bool val) override |
void | setDouble (const ::std::string &key, double val) override |
void | setDouble (unsigned int index, double val) override |
void | setDoubleArray (const ::std::string &key, const std::vector< double > &val) override |
void | setElement (const ::std::string &key, const armarx::AbstractObjectSerializerPtr &obj) override |
void | setElement (unsigned int index, const armarx::AbstractObjectSerializerPtr &obj) override |
void | setElementType (armarx::ElementType nodeType, const ::Ice::Current &=Ice::emptyCurrent) override |
void | setFloat (const ::std::string &key, float val) override |
void | setFloat (unsigned int index, float val) override |
void | setFloatArray (const ::std::string &key, const std::vector< float > &val) override |
void | setInt (const ::std::string &key, int val) override |
void | setInt (unsigned int index, int val) override |
void | setIntArray (const ::std::string &key, const std::vector< int > &val) override |
void | setString (const ::std::string &key, const std::string &val) override |
void | setString (unsigned int index, const std::string &val) override |
void | setStringArray (const ::std::string &key, const std::vector< std::string > &val) override |
void | setVariantArray (const ::std::string &key, const std::vector< armarx::VariantBasePtr > &val) override |
void | setVariantArray (const ::std::string &key, const std::vector< armarx::VariantPtr > &val) override |
void | setVariantMap (const ::std::string &key, const armarx::StringVariantBaseMap &val) override |
unsigned int | size () const override |
std::string | toString (const ::Ice::Current &=Ice::emptyCurrent) const override |
~JSONObject () override | |
Public Member Functions inherited from AbstractObjectSerializer | |
AbstractObjectSerializer () | |
AbstractObjectSerializer (const Ice::CommunicatorPtr ic) | |
SerializablePtr | deserializeIceObject () |
virtual SerializablePtr | getIceObject (const ::std::string &key) const |
virtual SerializablePtr | getIceObject (int index) const |
std::string | getIdField () const |
int | getIntId () const |
std::string | getStringId () const |
virtual VariantPtr | getVariant (const ::std::string &key) const |
virtual VariantPtr | getVariant (int index) const |
void | serializeIceObject (const SerializablePtr &obj) |
void | setIceCommunicator (Ice::CommunicatorPtr ic) |
virtual void | setIceObject (const ::std::string &key, const SerializablePtr &val) |
virtual void | setIceObject (unsigned int index, const SerializablePtr &val) |
void | setId (const std::string &val) |
void | setId (int val) |
void | setIdField (const std::string &fieldName) |
virtual void | setVariant (const ::std::string &key, const VariantPtr &val) |
virtual void | setVariant (unsigned int index, const VariantPtr &val) |
~AbstractObjectSerializer () override | |
Static Public Member Functions | |
static StringVariantBaseMap | ConvertToBasicVariantMap (const JSONObjectPtr &serializer, const VariantBasePtr &variant) |
Additional Inherited Members | |
Protected Member Functions inherited from AbstractObjectSerializer | |
VariantPtr | deserializeVariant () |
AbstractObjectSerializerPtr | serializeVariant (const VariantPtr &val) const |
Protected Attributes inherited from AbstractObjectSerializer | |
Ice::CommunicatorPtr | ic |
std::string | idField |
The JSONObject class is used to represent and (de)serialize JSON objects.
Accessing the object is not thread safe. (De)Serializing multiple JSON objects should be done with a new instance for each object.
Definition at line 43 of file JSONObject.h.
JSONObject | ( | armarx::ElementType | nodeType = armarx::ElementTypes::eObject , |
const Ice::CommunicatorPtr | ic = Ice::CommunicatorPtr() |
||
) |
Definition at line 34 of file JSONObject.cpp.
JSONObject | ( | const Ice::CommunicatorPtr | ic | ) |
JSONObject | ( | const JSONObject & | toCopy | ) |
|
override |
Definition at line 54 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 171 of file JSONObject.cpp.
std::string asString | ( | bool | pretty = false | ) | const |
|
static |
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 98 of file JSONObject.cpp.
|
override |
Definition at line 86 of file JSONObject.cpp.
|
inline |
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 357 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 321 of file JSONObject.cpp.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 99 of file JSONObject.h.
|
overridevirtual |
Implements AbstractObjectSerializer.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 394 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 430 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 483 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 303 of file JSONObject.cpp.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 95 of file JSONObject.h.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 339 of file JSONObject.cpp.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 91 of file JSONObject.h.
const Json::Value & getJsonValue | ( | ) | const |
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 375 of file JSONObject.cpp.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 103 of file JSONObject.h.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 442 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 463 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 207 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 185 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 518 of file JSONObject.cpp.
|
inline |
|
inline |
Definition at line 117 of file JSONObject.h.
|
inline |
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 140 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 182 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 152 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 194 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 170 of file JSONObject.h.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 104 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 165 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 499 of file JSONObject.cpp.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 148 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 190 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 166 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 144 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 186 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 162 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 156 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 198 of file JSONObject.h.
|
inlineoverridevirtual |
Implements AbstractObjectSerializer.
Definition at line 174 of file JSONObject.h.
|
overridevirtual |
Implements AbstractObjectSerializer.
|
overridevirtual |
Implements AbstractObjectSerializer.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 143 of file JSONObject.cpp.
|
overridevirtual |
Implements AbstractObjectSerializer.
Definition at line 202 of file JSONObject.cpp.
|
override |
Definition at line 58 of file JSONObject.cpp.