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

Public Member Functions

 SimpleJSONElement (::tenduke::json::JSONElement::Type type)
 
std::string asJSON () const override
 Serializes the element as JSON.
 
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.
 
- 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.
 

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::SimpleJSONElement::asJSON ( ) const
overridevirtual

Serializes the element as JSON.

Returns
- JSON representation of this element

Implements tenduke::json::JSONElement.

Reimplemented in SimpleJSONNumber, SimpleJSONObject, SimpleJSONString, tenduke::json::SimpleJSONNumber, tenduke::json::SimpleJSONObject, and tenduke::json::SimpleJSONString.

◆ asString()

std::string tenduke::json::SimpleJSONElement::asString ( ) const
overridevirtual

Gets the value of the element as a string.

This does not serialize the value as JSON, but just converts the actual value to string. Exceptions are tenduke::json::JSONArray and tenduke::json::JSONObject which return serialized value.

Returns
- String representation of this element

Implements tenduke::json::JSONElement.

Reimplemented in SimpleJSONString, and tenduke::json::SimpleJSONString.

◆ getType()

JSONElement::Type tenduke::json::SimpleJSONElement::getType ( ) const
overridevirtual

Returns type of this element.

Returns
-

Implements tenduke::json::JSONElement.


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