mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-02 16:14:19 +01:00
Added StaticJsonDocument and DynamicJsonDocument.
Removed StaticJsonArray and DynamicJsonArray. Removed StaticJsonObject and DynamicJsonObject. Removed StaticJsonVariant and DynamicJsonVariant.
This commit is contained in:
@@ -28,40 +28,6 @@ class MsgPackDeserializer {
|
||||
_writer(writer),
|
||||
_nestingLimit(nestingLimit) {}
|
||||
|
||||
MsgPackError parse(JsonArray &array) {
|
||||
uint8_t c = readOne();
|
||||
size_t n;
|
||||
|
||||
if ((c & 0xF0) == 0x90) {
|
||||
n = c & 0x0F;
|
||||
} else if (c == 0xdc) {
|
||||
n = readInteger<uint16_t>();
|
||||
} else if (c == 0xdd) {
|
||||
n = readInteger<uint32_t>();
|
||||
} else {
|
||||
return MsgPackError::NotAnArray;
|
||||
}
|
||||
|
||||
return readArray(array, n);
|
||||
}
|
||||
|
||||
MsgPackError parse(JsonObject &object) {
|
||||
uint8_t c = readOne();
|
||||
size_t n;
|
||||
|
||||
if ((c & 0xf0) == 0x80) {
|
||||
n = c & 0x0f;
|
||||
} else if (c == 0xde) {
|
||||
n = readInteger<uint16_t>();
|
||||
} else if (c == 0xdf) {
|
||||
n = readInteger<uint32_t>();
|
||||
} else {
|
||||
return MsgPackError::NotAnObject;
|
||||
}
|
||||
|
||||
return readObject(object, n);
|
||||
}
|
||||
|
||||
MsgPackError parse(JsonVariant &variant) {
|
||||
uint8_t c = readOne();
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace ArduinoJson {
|
||||
|
||||
class MsgPackError {
|
||||
public:
|
||||
enum Code { Ok, NotSupported, NoMemory, NotAnArray, NotAnObject, TooDeep };
|
||||
enum Code { Ok, NotSupported, NoMemory, TooDeep };
|
||||
|
||||
MsgPackError() {}
|
||||
|
||||
@@ -42,10 +42,6 @@ class MsgPackError {
|
||||
return "NotSupported";
|
||||
case NoMemory:
|
||||
return "NoMemory";
|
||||
case NotAnArray:
|
||||
return "NotAnArray";
|
||||
case NotAnObject:
|
||||
return "NotAnObject";
|
||||
case TooDeep:
|
||||
return "TooDeep";
|
||||
default:
|
||||
@@ -62,6 +58,11 @@ inline std::ostream& operator<<(std::ostream& os, const MsgPackError& err) {
|
||||
os << err.c_str();
|
||||
return os;
|
||||
}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, MsgPackError::Code code) {
|
||||
os << MsgPackError(code).c_str();
|
||||
return os;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace ArduinoJson
|
||||
|
||||
Reference in New Issue
Block a user