10Duke Enterprise C++ SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
CJsonArray.h
1
#ifndef TENDUKE_JSON_CJSONARRAY_H
2
#define TENDUKE_JSON_CJSONARRAY_H
3
4
#include "./CJsonElement.h"
5
#include "json/JSONArray.h"
6
7
#include <memory>
8
#include <vector>
9
10
namespace
tenduke
{
namespace
json
{
namespace
cjson
{
11
15
class
CjsonArray
:
public
tenduke::json::cjson::CjsonElement
,
public
tenduke::json::JSONArray
16
{
17
public
:
23
CjsonArray
(std::unique_ptr<std::vector<std::shared_ptr<tenduke::json::JSONElement>>> values, cJSON *
element
)
24
:
CjsonElement
(
JSONElement
::
Type
::ARRAY,
element
), values(std::move(values))
25
{}
26
27
~CjsonArray
()
override
;
28
29
// tenduke::json::JSONArray interface
30
public
:
31
bool
isEmpty
()
const override
{
return
values->empty();}
32
std::size_t
getSize
()
const override
{
return
values->size();}
33
const
std::vector<std::shared_ptr<tenduke::json::JSONElement>> &
getValues
()
const override
;
34
35
private
:
36
std::unique_ptr<std::vector<std::shared_ptr<tenduke::json::JSONElement>>> values;
37
};
38
39
}}}
40
41
#endif
// TENDUKE_JSON_CJSONARRAY_H
tenduke::json::JSONArray
A JSON array.
Definition
JSONArray.h:16
tenduke::json::JSONElement
Superclass of JSON elements.
Definition
JSONElement.h:12
tenduke::json::JSONElement::Type
Type
Type of the element.
Definition
JSONElement.h:17
tenduke::json::cjson::CjsonArray
cJSON-implementation of tenduke::json::JSONArray.
Definition
CJsonArray.h:16
tenduke::json::cjson::CjsonArray::getValues
const std::vector< std::shared_ptr< tenduke::json::JSONElement > > & getValues() const override
Returns the elements of the array.
Definition
CJsonArray.cpp:15
tenduke::json::cjson::CjsonArray::getSize
std::size_t getSize() const override
Returns number of elements in the array.
Definition
CJsonArray.h:32
tenduke::json::cjson::CjsonArray::CjsonArray
CjsonArray(std::unique_ptr< std::vector< std::shared_ptr< tenduke::json::JSONElement > > > values, cJSON *element)
Constructs new instance.
Definition
CJsonArray.h:23
tenduke::json::cjson::CjsonArray::isEmpty
bool isEmpty() const override
Checks if the array is empty.
Definition
CJsonArray.h:31
tenduke::json::cjson::CjsonElement
cJSON-implementation of tenduke::json::JSONElement.
Definition
CJsonElement.h:14
tenduke::json::cjson::CjsonElement::element
cJSON * element
Pointer to the cJSON element.
Definition
CJsonElement.h:62
tenduke::json::cjson::CjsonElement::CjsonElement
CjsonElement(enum tenduke::json::JSONElement::Type type, cJSON *element, bool root)
Constructs new instance.
Definition
CJsonElement.h:22
tenduke::json::cjson
Implementation of JSON service interfaces using cJSON.
Definition
CJsonArray.h:10
tenduke::json
JSON support.
Definition
JSONArray.h:10
tenduke
Root for classes, functions and globals of 10Duke C++ Client.
Definition
APIRequest.h:4
core
services
default
src
json
CJsonArray.h
Generated by
1.17.0