10Duke Scale C++ Client
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
10namespace tenduke { namespace json { namespace cjson {
11
16{
17public:
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
30public:
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
35private:
36 std::unique_ptr<std::vector<std::shared_ptr<tenduke::json::JSONElement>>> values;
37};
38
39}}}
40
41#endif // TENDUKE_JSON_CJSONARRAY_H
A JSON array.
Definition JSONArray.h:16
Superclass of JSON elements.
Definition JSONElement.h:12
Type
Type of the element.
Definition JSONElement.h:17
cJSON-implementation of tenduke::json::JSONArray.
Definition CJsonArray.h:16
const std::vector< std::shared_ptr< tenduke::json::JSONElement > > & getValues() const override
Returns the elements of the array.
Definition CJsonArray.cpp:15
std::size_t getSize() const override
Returns number of elements in the array.
Definition CJsonArray.h:32
CjsonArray(std::unique_ptr< std::vector< std::shared_ptr< tenduke::json::JSONElement > > > values, cJSON *element)
Constructs new instance.
Definition CJsonArray.h:23
bool isEmpty() const override
Checks if the array is empty.
Definition CJsonArray.h:31
cJSON-implementation of tenduke::json::JSONElement.
Definition CJsonElement.h:14
cJSON * element
Pointer to the cJSON element.
Definition CJsonElement.h:62
Implementation of JSON service interfaces using cJSON.
Definition CJsonArray.h:10
JSON support.
Definition JSONArray.h:10
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7