mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Simplified JsonWriter hierarchy
This commit is contained in:
@@ -17,8 +17,12 @@ class JsonWriter {
|
||||
|
||||
size_t bytesWritten() { return _length; }
|
||||
|
||||
void beginArray() { _length += _sink->write('['); }
|
||||
void endArray() { _length += _sink->write(']'); }
|
||||
void writeEmptyArray() { _length += _sink->print("[]"); }
|
||||
|
||||
void beginObject() { _length += _sink->write('{'); }
|
||||
void endObject() { _length += _sink->write('}'); }
|
||||
void writeEmptyObject() { _length += _sink->print("{}"); }
|
||||
|
||||
void writeString(const char *value);
|
||||
@@ -26,6 +30,9 @@ class JsonWriter {
|
||||
void writeBoolean(bool value);
|
||||
void writeDouble(double value, int decimals);
|
||||
|
||||
void writeColon() { _length += _sink->write(':'); }
|
||||
void writeComma() { _length += _sink->write(','); }
|
||||
|
||||
protected:
|
||||
Print *_sink;
|
||||
size_t _length;
|
||||
|
||||
Reference in New Issue
Block a user