10Duke Enterprise C++ Client
Loading...
Searching...
No Matches
SimpleJSONBoolean.h
1#ifndef TENDUKE_JSON_SIMPLEJSONBOOLEAN_H
2#define TENDUKE_JSON_SIMPLEJSONBOOLEAN_H
3
4#include "./SimpleJSONElement.h"
5#include "json/JSONBoolean.h"
6
7namespace tenduke { namespace json {
8
9class SimpleJSONBoolean : public virtual ::tenduke::json::JSONBoolean, public ::tenduke::json::SimpleJSONElement
10{
11public:
12 explicit SimpleJSONBoolean(bool value)
13 : SimpleJSONElement(::tenduke::json::JSONElement::BOOLEAN), value(value)
14 {
15 }
16
17 std::string asJSON() const override
18 {
19 return (value == true ? "true" : "false");
20 }
21
22 bool getValue() const override
23 {
24 return value;
25 }
26
27private:
28 bool value;
29};
30
31}}
32
33#endif //TENDUKE_JSON_SIMPLEJSONBOOLEAN_H
JSON boolean.
Definition JSONBoolean.h:12
bool getValue() const override
Returns the value.
Definition SimpleJSONBoolean.h:22
std::string asJSON() const override
Serializes the element as JSON.
Definition SimpleJSONBoolean.h:17
Definition SimpleJSONElement.h:11
JSON support.
Definition JSONArray.h:10
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4