mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-18 13:02:25 +02:00
Added operator[]
This commit is contained in:
@ -16,16 +16,18 @@ namespace ArduinoJson
|
||||
{
|
||||
public:
|
||||
|
||||
JsonValue& operator[](const char*);
|
||||
|
||||
template<typename T>
|
||||
void add(const char* key, T value)
|
||||
{
|
||||
getValue(key) = value;
|
||||
operator[](key) = value;
|
||||
}
|
||||
|
||||
template<int DIGITS>
|
||||
void add(const char* key, double value)
|
||||
{
|
||||
getValue(key).set<DIGITS>(value);
|
||||
operator[](key).set<DIGITS>(value);
|
||||
}
|
||||
|
||||
using JsonPrintable::printTo;
|
||||
@ -45,8 +47,6 @@ namespace ArduinoJson
|
||||
{
|
||||
}
|
||||
|
||||
JsonValue& getValue(const char* key);
|
||||
|
||||
private:
|
||||
KeyValuePair* items;
|
||||
int capacity, count;
|
||||
|
Reference in New Issue
Block a user