10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
tenduke::json::SimpleJSONObject Class Reference
Inheritance diagram for tenduke::json::SimpleJSONObject:
tenduke::json::JSONObject tenduke::json::SimpleJSONElement tenduke::json::JSONElement tenduke::json::JSONElement

Public Member Functions

std::shared_ptr<::tenduke::json::JSONElementgetProperty (const std::string &propertyName) const override
 Returns object property by name.
 
bool hasProperty (const std::string &propertyName) const override
 Checks if the object has a property with given name.
 
std::shared_ptr<::tenduke::json::JSONElementremoveProperty (const std::string &propertyName) override
 Removes property from this object.
 
const std::map< std::string, std::shared_ptr< JSONElement > > & getProperties () const override
 Returns all properties of this object.
 
std::string asJSON () const override
 Serializes the element as JSON.
 
virtual void addProperty (const std::string &name, const std::shared_ptr<::tenduke::json::JSONElement > &value)
 
- Public Member Functions inherited from tenduke::json::JSONElement
bool isArray () const
 Utility to check if this element is JSONArray.
 
bool isBoolean () const
 Utility to check if this element is JSONBoolean.
 
bool isNull () const
 Utility to check if this element is null.
 
bool isNumber () const
 Utility to check if this element is JSONNumber.
 
bool isObject () const
 Utility to check if this element is JSONObject.
 
bool isString () const
 Utility to check if this element is JSONString.
 
bool isUndefined () const
 Utility to check if this element is undefined.
 
- Public Member Functions inherited from tenduke::json::SimpleJSONElement
 SimpleJSONElement (::tenduke::json::JSONElement::Type type)
 
std::string asString () const override
 Gets the value of the element as a string.
 
::tenduke::json::JSONElement::Type getType () const override
 Returns type of this element.
 

Additional Inherited Members

- Public Types inherited from tenduke::json::JSONElement
enum  Type {
  UNDEFINED , NULLISH , OBJECT , ARRAY ,
  NUMBER , STRING , BOOLEAN
}
 Type of the element.
 
- Static Public Member Functions inherited from tenduke::json::JSONElement
static std::string typeToString (const enum Type type)
 Converts the type to string.
 

Member Function Documentation

◆ asJSON()

std::string tenduke::json::SimpleJSONObject::asJSON ( ) const
inlineoverridevirtual

Serializes the element as JSON.

Returns
- JSON representation of this element

Implements tenduke::json::JSONElement.

◆ getProperties()

const std::map< std::string, std::shared_ptr< JSONElement > > & tenduke::json::SimpleJSONObject::getProperties ( ) const
inlineoverridevirtual

Returns all properties of this object.

Returns
-

Implements tenduke::json::JSONObject.

◆ getProperty()

std::shared_ptr<::tenduke::json::JSONElement > tenduke::json::SimpleJSONObject::getProperty ( const std::string & propertyName) const
inlineoverridevirtual

Returns object property by name.

Parameters
propertyName-
Returns
the property. Returns null if no such property.

Implements tenduke::json::JSONObject.

◆ hasProperty()

bool tenduke::json::SimpleJSONObject::hasProperty ( const std::string & propertyName) const
inlineoverridevirtual

Checks if the object has a property with given name.

Parameters
propertyName-
Returns
true if the object contains property with given name

Implements tenduke::json::JSONObject.

◆ removeProperty()

std::shared_ptr<::tenduke::json::JSONElement > tenduke::json::SimpleJSONObject::removeProperty ( const std::string & propertyName)
inlineoverridevirtual

Removes property from this object.

Parameters
propertyName-
Returns
the removed property

Implements tenduke::json::JSONObject.


The documentation for this class was generated from the following file: