10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::json::cjson::CjsonArray Class Reference

#include <CJsonArray.h>

Detailed Description

cJSON-implementation of tenduke::json::JSONArray.

Inheritance diagram for tenduke::json::cjson::CjsonArray:
tenduke::json::cjson::CjsonElement tenduke::json::JSONArray tenduke::json::JSONElement tenduke::json::JSONElement

Public Member Functions

 CjsonArray (std::unique_ptr< std::vector< std::shared_ptr< tenduke::json::JSONElement > > > values, cJSON *element)
 Constructs new instance.
 
bool isEmpty () const override
 Checks if the array is empty.
 
std::size_t getSize () const override
 Returns number of elements in the array.
 
const std::vector< std::shared_ptr< tenduke::json::JSONElement > > & getValues () const override
 Returns the elements of the array.
 
- Public Member Functions inherited from tenduke::json::cjson::CjsonElement
 CjsonElement (enum tenduke::json::JSONElement::Type type, cJSON *element, bool root)
 Constructs new instance.
 
 CjsonElement (enum tenduke::json::JSONElement::Type type, cJSON *element)
 Constructs new instance.
 
std::string asString () const override
 Returns string representation of this element.
 
enum Type getType () const override
 Returns type of this element.
 
void setRoot (bool p_root)
 Marks this node as root element.
 
cJSON * getCjsonElement () const
 Returns the pointer to cJSON-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.
 
- Protected Attributes inherited from tenduke::json::cjson::CjsonElement
cJSON * element
 Pointer to the cJSON element.
 

Constructor & Destructor Documentation

◆ CjsonArray()

tenduke::json::cjson::CjsonArray::CjsonArray ( std::unique_ptr< std::vector< std::shared_ptr< tenduke::json::JSONElement > > >  values,
cJSON *  element 
)
inline

Constructs new instance.

Parameters
values-
element-

Member Function Documentation

◆ getSize()

std::size_t tenduke::json::cjson::CjsonArray::getSize ( ) const
inlineoverridevirtual

Returns number of elements in the array.

Returns
-

Implements tenduke::json::JSONArray.

◆ getValues()

const std::vector< std::shared_ptr< xdjson::JSONElement > > & tenduke::json::cjson::CjsonArray::getValues ( ) const
overridevirtual

Returns the elements of the array.

Returns
-

Implements tenduke::json::JSONArray.

◆ isEmpty()

bool tenduke::json::cjson::CjsonArray::isEmpty ( ) const
inlineoverridevirtual

Checks if the array is empty.

Returns
true if the array is empty.

Implements tenduke::json::JSONArray.


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