10Duke Scale C++ Client
Loading...
Searching...
No Matches
CJsonString.h
1#ifndef TENDUKE_JSON_CJSONSTRING_H
2#define TENDUKE_JSON_CJSONSTRING_H
3
4#include "./CJsonElement.h"
5#include "json/JSONString.h"
6
7namespace tenduke { namespace json { namespace cjson {
8
13{
14public:
20 CjsonString(std::string value, cJSON * element)
21 : CjsonElement(JSONElement::Type::STRING, element), value(std::move(value))
22 {}
23 ~CjsonString() override = default;
24
25 std::string asString() const override
26 {
27 return value;
28 }
29 std::string getValue() const override {return value;}
30
31private:
32 std::string value;
33};
34
35}}}
36
37#endif // TENDUKE_JSON_CJSONSTRING_H
Superclass of JSON elements.
Definition JSONElement.h:12
Type
Type of the element.
Definition JSONElement.h:17
JSON string element.
Definition JSONString.h:14
cJSON-implementation of tenduke::json::JSONElement.
Definition CJsonElement.h:14
cJSON * element
Pointer to the cJSON element.
Definition CJsonElement.h:62
cJSON-implementation of tenduke::json::JSONString.
Definition CJsonString.h:13
std::string asString() const override
Returns string representation of this element.
Definition CJsonString.h:25
std::string getValue() const override
Returns the value of this string.
Definition CJsonString.h:29
CjsonString(std::string value, cJSON *element)
Constructs new instance.
Definition CJsonString.h:20
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