mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-16 12:02:14 +02:00
Huge refactoring in progress...
This commit is contained in:
@ -18,6 +18,9 @@ class JsonObjectNode {
|
||||
|
||||
JsonPair pair;
|
||||
JsonObjectNode* next;
|
||||
|
||||
// warning C4512: assignment operator could not be generated
|
||||
#pragma warning( suppress : 4512 )
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class JsonArray : public JsonPrintable {
|
||||
static JsonArray _invalid;
|
||||
};
|
||||
|
||||
bool operator==(const JsonArray &left, const JsonArray &right) {
|
||||
inline bool operator==(const JsonArray &left, const JsonArray &right) {
|
||||
// two JsonArray are equal if they are the same instance
|
||||
// (we don't compare the content)
|
||||
return &left == &right;
|
||||
|
@ -72,7 +72,7 @@ class JsonObject : public JsonPrintable {
|
||||
static JsonObject _invalid;
|
||||
};
|
||||
|
||||
bool operator==(const JsonObject &left, const JsonObject &right) {
|
||||
inline bool operator==(const JsonObject &left, const JsonObject &right) {
|
||||
// two JsonObject are equal if they are the same instance
|
||||
// (we don't compare the content)
|
||||
return &left == &right;
|
||||
|
@ -16,5 +16,8 @@ struct JsonPair {
|
||||
|
||||
const char* const key;
|
||||
JsonValue value;
|
||||
|
||||
// warning C4512: assignment operator could not be generated
|
||||
#pragma warning( suppress : 4512 )
|
||||
};
|
||||
}
|
||||
}
|
@ -45,6 +45,7 @@ class JsonValue {
|
||||
operator const char *() const;
|
||||
operator double() const;
|
||||
operator long() const;
|
||||
operator int() const { return operator long(); }
|
||||
operator JsonArray &() const;
|
||||
operator JsonObject &() const;
|
||||
|
||||
|
@ -39,7 +39,7 @@ JsonValue &JsonArray::add() {
|
||||
}
|
||||
|
||||
JsonArrayNode *JsonArray::createNode() {
|
||||
if (_buffer) return NULL;
|
||||
if (!_buffer) return NULL;
|
||||
void *ptr = _buffer->alloc(sizeof(JsonArrayNode));
|
||||
return ptr ? new (ptr) JsonArrayNode() : NULL;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ class JsonObject_Container_Tests : public ::testing::Test {
|
||||
JsonObject_Container_Tests() : object(json.createObject()) {}
|
||||
|
||||
protected:
|
||||
StaticJsonBuffer<42> json;
|
||||
StaticJsonBuffer<256> json;
|
||||
JsonObject& object;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user