10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::json::JSONElement Class Referenceabstract

#include <JSONElement.h>

Detailed Description

Superclass of JSON elements.

Inheritance diagram for tenduke::json::JSONElement:
tenduke::json::JSONArray tenduke::json::JSONBoolean tenduke::json::JSONNumber tenduke::json::JSONObject tenduke::json::JSONString tenduke::json::cjson::CjsonElement tenduke::test::mocks::JSONElementMock tenduke::json::cjson::CjsonArray tenduke::test::mocks::JSONArrayMock tenduke::json::cjson::CjsonBoolean tenduke::test::mocks::JSONBooleanMock tenduke::json::cjson::CjsonNumber tenduke::test::mocks::JSONNumberMock tenduke::json::cjson::CjsonObject tenduke::test::mocks::JSONObjectMock tenduke::json::cjson::CjsonString tenduke::test::mocks::JSONStringMock tenduke::json::cjson::CjsonArray tenduke::json::cjson::CjsonBoolean tenduke::json::cjson::CjsonNumber tenduke::json::cjson::CjsonObject tenduke::json::cjson::CjsonString

Public Types

enum  Type {
  UNDEFINED , NULLISH , OBJECT , ARRAY ,
  NUMBER , STRING , BOOLEAN
}
 Type of the element.
 

Public Member Functions

virtual enum Type getType () const =0
 Returns type of this element.
 
virtual std::string asString () const =0
 Returns string representation of this element.
 
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.
 

Static Public Member Functions

static std::string typeToString (const enum Type type)
 Converts the type to string.
 

Member Function Documentation

◆ asString()

virtual std::string tenduke::json::JSONElement::asString ( ) const
pure virtual

◆ getType()

virtual enum Type tenduke::json::JSONElement::getType ( ) const
pure virtual

Returns type of this element.

Returns
-

Implemented in tenduke::json::cjson::CjsonElement.

◆ isArray()

bool tenduke::json::JSONElement::isArray ( ) const
inline

Utility to check if this element is JSONArray.

Returns
-

◆ isBoolean()

bool tenduke::json::JSONElement::isBoolean ( ) const
inline

Utility to check if this element is JSONBoolean.

Returns
-

◆ isNull()

bool tenduke::json::JSONElement::isNull ( ) const
inline

Utility to check if this element is null.

Returns
-

◆ isNumber()

bool tenduke::json::JSONElement::isNumber ( ) const
inline

Utility to check if this element is JSONNumber.

Returns
-

◆ isObject()

bool tenduke::json::JSONElement::isObject ( ) const
inline

Utility to check if this element is JSONObject.

Returns
-

◆ isString()

bool tenduke::json::JSONElement::isString ( ) const
inline

Utility to check if this element is JSONString.

Returns
-

◆ isUndefined()

bool tenduke::json::JSONElement::isUndefined ( ) const
inline

Utility to check if this element is undefined.

Returns
-

◆ typeToString()

static std::string tenduke::json::JSONElement::typeToString ( const enum Type  type)
inlinestatic

Converts the type to string.

Parameters
type-
Returns
-

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