mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 08:48:30 +01:00
Parse empty object
This commit is contained in:
@@ -162,6 +162,11 @@ namespace ArduinoJson
|
||||
return type == JSON_ARRAY;
|
||||
}
|
||||
|
||||
bool isObject()
|
||||
{
|
||||
return type == JSON_OBJECT;
|
||||
}
|
||||
|
||||
void addChild(JsonNode* childToAdd);
|
||||
|
||||
void removeChild(JsonNode* childToRemove);
|
||||
|
||||
@@ -33,6 +33,8 @@ namespace ArduinoJson
|
||||
inline bool isEnd();
|
||||
inline bool isLong();
|
||||
inline bool isNull();
|
||||
inline bool isObjectStop();
|
||||
inline bool isObjectStart();
|
||||
inline bool isSpace();
|
||||
|
||||
inline void skipOneChar();
|
||||
@@ -42,6 +44,7 @@ namespace ArduinoJson
|
||||
inline JsonNode* parseBoolean();
|
||||
inline JsonNode* parseLong();
|
||||
inline JsonNode* parseNull();
|
||||
inline JsonNode* parseObject();
|
||||
inline JsonNode* parseString();
|
||||
|
||||
JsonNode *parseDouble();
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace ArduinoJson
|
||||
JsonValue createValue();
|
||||
|
||||
JsonArray parseArray(char* json);
|
||||
|
||||
JsonValue parseValue(char* json);
|
||||
JsonObject parseObject(char* json);
|
||||
JsonValue parseValue(char* json); // TODO: remove
|
||||
|
||||
protected:
|
||||
virtual void* allocateNode() = 0;
|
||||
|
||||
@@ -23,6 +23,11 @@ namespace ArduinoJson
|
||||
JsonArray createNestedArray(const char* key);
|
||||
JsonObject createNestedObject(const char* key);
|
||||
|
||||
bool success()
|
||||
{
|
||||
return _node && _node->isObject();
|
||||
}
|
||||
|
||||
private:
|
||||
Internals::JsonNode* getOrCreateNodeAt(const char* key);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user