10Duke Enterprise C++ SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
CJsonBoolean.h
1
#ifndef TENDUKE_JSON_CJSONBOOLEAN_H
2
#define TENDUKE_JSON_CJSONBOOLEAN_H
3
4
#include "./CJsonElement.h"
5
#include "json/JSONBoolean.h"
6
7
namespace
tenduke
{
namespace
json
{
namespace
cjson
{
8
10
const
std::string
TRUE
=
"true"
;
11
13
const
std::string
FALSE
=
"false"
;
14
18
class
CjsonBoolean
:
public
tenduke::json::cjson::CjsonElement
,
public
tenduke::json::JSONBoolean
19
{
20
public
:
26
CjsonBoolean
(
bool
value, cJSON *
element
)
27
:
CjsonElement
(
JSONElement
::
Type
::BOOLEAN,
element
), value(value)
28
{}
29
~CjsonBoolean
()
override
=
default
;
30
31
// tenduke::json::JSONBoolean interface
32
public
:
33
std::string
asString
()
const override
34
{
35
return
(value ?
TRUE
:
FALSE
);
36
}
37
bool
getValue
()
const override
{
return
value;}
38
39
private
:
40
bool
value;
41
};
42
43
}}}
44
45
#endif
// TENDUKE_JSON_CJSONBOOLEAN_H
tenduke::json::JSONBoolean
JSON boolean.
Definition
JSONBoolean.h:12
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::CjsonBoolean
cJSON-implementation of tenduke::json::JSONBoolean.
Definition
CJsonBoolean.h:19
tenduke::json::cjson::CjsonBoolean::CjsonBoolean
CjsonBoolean(bool value, cJSON *element)
Constructs new instance.
Definition
CJsonBoolean.h:26
tenduke::json::cjson::CjsonBoolean::getValue
bool getValue() const override
Returns the value.
Definition
CJsonBoolean.h:37
tenduke::json::cjson::CjsonBoolean::asString
std::string asString() const override
Gets the value of the element as a string.
Definition
CJsonBoolean.h:33
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::cjson::FALSE
const std::string FALSE
String value for boolean false.
Definition
CJsonBoolean.h:13
tenduke::json::cjson::TRUE
const std::string TRUE
String value for boolean true.
Definition
CJsonBoolean.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
CJsonBoolean.h
Generated by
1.17.0