forked from bblanchon/ArduinoJson
Extracted class JsonValue
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "StringBuilder.h"
|
||||
#include "JsonValue.h"
|
||||
|
||||
class JsonObjectBase
|
||||
{
|
||||
@ -17,32 +17,6 @@ public:
|
||||
writeTo(sb);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
enum JsonValueType
|
||||
{
|
||||
JSON_STRING,
|
||||
JSON_NUMBER,
|
||||
JSON_BOOLEAN,
|
||||
JSON_OBJECT,
|
||||
};
|
||||
|
||||
union JsonValueContent
|
||||
{
|
||||
const char* string;
|
||||
double number;
|
||||
bool boolean;
|
||||
JsonObjectBase* object;
|
||||
};
|
||||
|
||||
struct JsonValue
|
||||
{
|
||||
JsonValueType type;
|
||||
JsonValueContent content;
|
||||
};
|
||||
|
||||
void writeValueTo(JsonValue& obj, StringBuilder& sb);
|
||||
|
||||
virtual void writeTo(StringBuilder& sb) = 0;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user