2014-09-27 11:53:26 +02:00
|
|
|
#pragma once
|
|
|
|
|
2014-10-05 15:13:00 +02:00
|
|
|
class JsonArray;
|
|
|
|
class JsonContainer;
|
2014-10-05 14:55:14 +02:00
|
|
|
class JsonObject;
|
2014-09-27 15:34:34 +02:00
|
|
|
struct JsonNode;
|
2014-09-27 11:53:26 +02:00
|
|
|
|
|
|
|
class JsonValue
|
|
|
|
{
|
2014-09-27 14:51:50 +02:00
|
|
|
public:
|
2014-09-27 15:04:06 +02:00
|
|
|
|
2014-09-27 16:18:40 +02:00
|
|
|
explicit JsonValue()
|
|
|
|
: _node(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-09-27 15:04:06 +02:00
|
|
|
explicit JsonValue(JsonNode* node)
|
2014-09-27 14:51:50 +02:00
|
|
|
: _node(node)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-09-27 15:04:06 +02:00
|
|
|
void operator=(bool);
|
2014-09-27 15:24:16 +02:00
|
|
|
void operator=(const char*);
|
2014-10-09 12:14:10 +02:00
|
|
|
void operator=(double x) { set(x, 2); }
|
2014-09-27 14:51:50 +02:00
|
|
|
void operator=(int);
|
2014-10-05 15:13:00 +02:00
|
|
|
void operator=(const JsonContainer&);
|
2014-09-28 21:18:43 +02:00
|
|
|
void operator=(const JsonValue&);
|
2014-09-27 16:18:40 +02:00
|
|
|
|
2014-09-27 15:25:00 +02:00
|
|
|
operator bool() const;
|
|
|
|
operator const char*() const;
|
|
|
|
operator double() const;
|
2014-10-09 12:14:10 +02:00
|
|
|
operator long() const;
|
|
|
|
operator int() const { return operator long(); }
|
2014-10-05 15:13:00 +02:00
|
|
|
operator JsonArray() const;
|
2014-09-27 16:18:40 +02:00
|
|
|
operator JsonObject() const;
|
2014-09-27 14:51:50 +02:00
|
|
|
|
2014-09-30 17:32:45 +02:00
|
|
|
void set(double value, int decimals);
|
|
|
|
|
2014-09-27 14:51:50 +02:00
|
|
|
private:
|
|
|
|
JsonNode* _node;
|
2014-09-30 17:32:45 +02:00
|
|
|
};
|