| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #pragma once
- class JsonBuffer;
- enum JsonNodeType
- {
- JSON_UNDEFINED,
- JSON_PROXY,
- JSON_NULL,
- JSON_ARRAY,
- JSON_OBJECT,
- JSON_KEY,
- JSON_BOOLEAN,
- JSON_STRING,
- JSON_INTEGER,
- JSON_DOUBLE_0_DECIMALS,
- JSON_DOUBLE_1_DECIMAL,
- JSON_DOUBLE_2_DECIMALS,
- // etc.
- };
- struct JsonNode
- {
- JsonNode* next;
- JsonNodeType type;
- union
- {
- bool asBoolean;
- double asDouble;
- int asInteger;
- const char* asString;
- struct
- {
- const char* key;
- JsonNode* value;
- } asKey;
- struct
- {
- JsonNode* child;
- JsonBuffer* buffer;
- } asObject;
- struct
- {
- JsonNode* target;
- } asProxy;
- } content;
- };
|