10Duke Enterprise C++ SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
CJsonElement.h
1
#ifndef TENDUKE_JSON_CJSONELEMENT_H
2
#define TENDUKE_JSON_CJSONELEMENT_H
3
4
#include "json/JSONElement.h"
5
6
#include <cjson/cJSON.h>
7
8
namespace
tenduke
{
namespace
json
{
namespace
cjson
{
9
13
class
CjsonElement
:
virtual
public
tenduke::json::JSONElement
14
{
15
public
:
22
CjsonElement
(
23
enum
tenduke::json::JSONElement::Type
type,
24
cJSON *
element
,
25
bool
root
26
) :
element
(
element
), type(type), root(root)
27
{}
28
34
CjsonElement
(
35
enum
tenduke::json::JSONElement::Type
type,
36
cJSON *
element
37
) :
CjsonElement
(type,
element
, false)
38
{}
39
40
~CjsonElement
()
override
;
41
42
// Implementations:
43
public
:
44
std::string
asString
()
const override
;
45
enum
Type
getType
()
const override
{
return
type;}
46
51
void
setRoot
(
bool
p_root) {this->root = p_root;}
52
58
cJSON *
getCjsonElement
()
const
{
return
element
;}
59
60
protected
:
62
cJSON *
element
;
63
64
private
:
65
enum
Type
type;
66
bool
root;
67
};
68
69
}}}
70
71
#endif
// TENDUKE_JSON_CJSONELEMENT_H
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::CjsonElement
cJSON-implementation of tenduke::json::JSONElement.
Definition
CJsonElement.h:14
tenduke::json::cjson::CjsonElement::getType
enum Type getType() const override
Returns type of this element.
Definition
CJsonElement.h:45
tenduke::json::cjson::CjsonElement::asString
std::string asString() const override
Gets the value of the element as a string.
Definition
CJsonElement.cpp:16
tenduke::json::cjson::CjsonElement::CjsonElement
CjsonElement(enum tenduke::json::JSONElement::Type type, cJSON *element)
Constructs new instance.
Definition
CJsonElement.h:34
tenduke::json::cjson::CjsonElement::getCjsonElement
cJSON * getCjsonElement() const
Returns the pointer to cJSON-element.
Definition
CJsonElement.h:58
tenduke::json::cjson::CjsonElement::element
cJSON * element
Pointer to the cJSON element.
Definition
CJsonElement.h:62
tenduke::json::cjson::CjsonElement::setRoot
void setRoot(bool p_root)
Marks this node as root element.
Definition
CJsonElement.h:51
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
CJsonElement.h
Generated by
1.17.0