mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-19 21:42:30 +02:00
Rename Pair
to JsonPair
This commit is contained in:
@ -53,8 +53,8 @@ typedef ARDUINOJSON_NAMESPACE::Float JsonFloat;
|
|||||||
typedef ARDUINOJSON_NAMESPACE::Integer JsonInteger;
|
typedef ARDUINOJSON_NAMESPACE::Integer JsonInteger;
|
||||||
using ARDUINOJSON_NAMESPACE::JsonObject;
|
using ARDUINOJSON_NAMESPACE::JsonObject;
|
||||||
using ARDUINOJSON_NAMESPACE::JsonObjectConst;
|
using ARDUINOJSON_NAMESPACE::JsonObjectConst;
|
||||||
typedef ARDUINOJSON_NAMESPACE::Pair JsonPair;
|
using ARDUINOJSON_NAMESPACE::JsonPair;
|
||||||
typedef ARDUINOJSON_NAMESPACE::PairConst JsonPairConst;
|
using ARDUINOJSON_NAMESPACE::JsonPairConst;
|
||||||
typedef ARDUINOJSON_NAMESPACE::String JsonString;
|
typedef ARDUINOJSON_NAMESPACE::String JsonString;
|
||||||
typedef ARDUINOJSON_NAMESPACE::UInt JsonUInt;
|
typedef ARDUINOJSON_NAMESPACE::UInt JsonUInt;
|
||||||
typedef ARDUINOJSON_NAMESPACE::VariantConstRef JsonVariantConst;
|
typedef ARDUINOJSON_NAMESPACE::VariantConstRef JsonVariantConst;
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
namespace ARDUINOJSON_NAMESPACE {
|
namespace ARDUINOJSON_NAMESPACE {
|
||||||
// A key value pair for CollectionData.
|
// A key value pair for CollectionData.
|
||||||
class Pair {
|
class JsonPair {
|
||||||
public:
|
public:
|
||||||
Pair(MemoryPool* pool, VariantSlot* slot) {
|
JsonPair(MemoryPool* pool, VariantSlot* slot) {
|
||||||
if (slot) {
|
if (slot) {
|
||||||
_key = String(slot->key(),
|
_key = String(slot->key(),
|
||||||
slot->ownsKey() ? String::Copied : String::Linked);
|
slot->ownsKey() ? String::Copied : String::Linked);
|
||||||
@ -33,9 +33,9 @@ class Pair {
|
|||||||
VariantRef _value;
|
VariantRef _value;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PairConst {
|
class JsonPairConst {
|
||||||
public:
|
public:
|
||||||
PairConst(const VariantSlot* slot) {
|
JsonPairConst(const VariantSlot* slot) {
|
||||||
if (slot) {
|
if (slot) {
|
||||||
_key = String(slot->key(),
|
_key = String(slot->key(),
|
||||||
slot->ownsKey() ? String::Copied : String::Linked);
|
slot->ownsKey() ? String::Copied : String::Linked);
|
@ -4,25 +4,25 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <ArduinoJson/Object/Pair.hpp>
|
#include <ArduinoJson/Object/JsonPair.hpp>
|
||||||
#include <ArduinoJson/Variant/SlotFunctions.hpp>
|
#include <ArduinoJson/Variant/SlotFunctions.hpp>
|
||||||
|
|
||||||
namespace ARDUINOJSON_NAMESPACE {
|
namespace ARDUINOJSON_NAMESPACE {
|
||||||
|
|
||||||
class PairPtr {
|
class JsonPairPtr {
|
||||||
public:
|
public:
|
||||||
PairPtr(MemoryPool* pool, VariantSlot* slot) : _pair(pool, slot) {}
|
JsonPairPtr(MemoryPool* pool, VariantSlot* slot) : _pair(pool, slot) {}
|
||||||
|
|
||||||
const Pair* operator->() const {
|
const JsonPair* operator->() const {
|
||||||
return &_pair;
|
return &_pair;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Pair& operator*() const {
|
const JsonPair& operator*() const {
|
||||||
return _pair;
|
return _pair;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Pair _pair;
|
JsonPair _pair;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ObjectIterator {
|
class ObjectIterator {
|
||||||
@ -34,11 +34,11 @@ class ObjectIterator {
|
|||||||
explicit ObjectIterator(MemoryPool* pool, VariantSlot* slot)
|
explicit ObjectIterator(MemoryPool* pool, VariantSlot* slot)
|
||||||
: _pool(pool), _slot(slot) {}
|
: _pool(pool), _slot(slot) {}
|
||||||
|
|
||||||
Pair operator*() const {
|
JsonPair operator*() const {
|
||||||
return Pair(_pool, _slot);
|
return JsonPair(_pool, _slot);
|
||||||
}
|
}
|
||||||
PairPtr operator->() {
|
JsonPairPtr operator->() {
|
||||||
return PairPtr(_pool, _slot);
|
return JsonPairPtr(_pool, _slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const ObjectIterator& other) const {
|
bool operator==(const ObjectIterator& other) const {
|
||||||
@ -64,20 +64,20 @@ class ObjectIterator {
|
|||||||
VariantSlot* _slot;
|
VariantSlot* _slot;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PairConstPtr {
|
class JsonPairConstPtr {
|
||||||
public:
|
public:
|
||||||
PairConstPtr(const VariantSlot* slot) : _pair(slot) {}
|
JsonPairConstPtr(const VariantSlot* slot) : _pair(slot) {}
|
||||||
|
|
||||||
const PairConst* operator->() const {
|
const JsonPairConst* operator->() const {
|
||||||
return &_pair;
|
return &_pair;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PairConst& operator*() const {
|
const JsonPairConst& operator*() const {
|
||||||
return _pair;
|
return _pair;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PairConst _pair;
|
JsonPairConst _pair;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ObjectConstIterator {
|
class ObjectConstIterator {
|
||||||
@ -88,11 +88,11 @@ class ObjectConstIterator {
|
|||||||
|
|
||||||
explicit ObjectConstIterator(const VariantSlot* slot) : _slot(slot) {}
|
explicit ObjectConstIterator(const VariantSlot* slot) : _slot(slot) {}
|
||||||
|
|
||||||
PairConst operator*() const {
|
JsonPairConst operator*() const {
|
||||||
return PairConst(_slot);
|
return JsonPairConst(_slot);
|
||||||
}
|
}
|
||||||
PairConstPtr operator->() {
|
JsonPairConstPtr operator->() {
|
||||||
return PairConstPtr(_slot);
|
return JsonPairConstPtr(_slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const ObjectConstIterator& other) const {
|
bool operator==(const ObjectConstIterator& other) const {
|
||||||
|
Reference in New Issue
Block a user