mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-02 00:38:26 +01:00
Huge refactoring in progress...
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
namespace ArduinoJson {
|
||||
namespace Internals {
|
||||
|
||||
class CompactJsonWriter : public JsonWriter {
|
||||
public:
|
||||
explicit CompactJsonWriter(Print *sink) : JsonWriter(sink) {}
|
||||
|
||||
@@ -14,16 +14,10 @@ namespace Internals {
|
||||
|
||||
class JsonArrayNode {
|
||||
public:
|
||||
static JsonArrayNode* createFrom(JsonBuffer* buffer) {
|
||||
void* ptr = buffer->alloc(sizeof(JsonArrayNode));
|
||||
return ptr ? new (ptr) JsonArrayNode() : NULL;
|
||||
}
|
||||
JsonArrayNode() : next(0) {}
|
||||
|
||||
JsonArrayNode* next;
|
||||
JsonValue value;
|
||||
|
||||
private:
|
||||
JsonArrayNode() : next(0) {}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,16 +14,10 @@ namespace Internals {
|
||||
|
||||
class JsonObjectNode {
|
||||
public:
|
||||
static JsonObjectNode* createFrom(JsonBuffer* buffer, const char* key) {
|
||||
void* ptr = buffer->alloc(sizeof(JsonObjectNode));
|
||||
return ptr ? new (ptr) JsonObjectNode(key) : NULL;
|
||||
}
|
||||
JsonObjectNode(const char* k) : pair(k), next(NULL) {}
|
||||
|
||||
JsonPair pair;
|
||||
JsonObjectNode* next;
|
||||
|
||||
private:
|
||||
JsonObjectNode(const char* k) : pair(k), next(NULL) {}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,4 @@ class JsonSerializer {
|
||||
JsonWriter &_writer;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
namespace ArduinoJson {
|
||||
namespace Internals {
|
||||
|
||||
class JsonWriter {
|
||||
public:
|
||||
explicit JsonWriter(Print *sink) : _sink(sink), _length(0) {}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace ArduinoJson {
|
||||
namespace Internals {
|
||||
|
||||
class PrettyJsonWriter : public JsonWriter {
|
||||
public:
|
||||
explicit PrettyJsonWriter(IndentedPrint *sink)
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
|
||||
namespace ArduinoJson {
|
||||
namespace Internals {
|
||||
|
||||
class QuotedString {
|
||||
public:
|
||||
static size_t printTo(const char *, Print *);
|
||||
|
||||
static char *extractFrom(char *input, char **end);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user