forked from bblanchon/ArduinoJson
Replaced set() by operator=()
This commit is contained in:
@ -25,7 +25,7 @@ namespace ArduinoJson
|
|||||||
{
|
{
|
||||||
if (count >= capacity) return;
|
if (count >= capacity) return;
|
||||||
|
|
||||||
items[count++].set(value);
|
items[count++] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int DIGITS>
|
template<int DIGITS>
|
||||||
|
@ -19,7 +19,7 @@ namespace ArduinoJson
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
void add(const char* key, T value)
|
void add(const char* key, T value)
|
||||||
{
|
{
|
||||||
getValue(key).set(value);
|
getValue(key) = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int DIGITS>
|
template<int DIGITS>
|
||||||
|
@ -17,37 +17,37 @@ namespace ArduinoJson
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void set(bool value)
|
void operator=(bool value)
|
||||||
{
|
{
|
||||||
printToImpl = &printBoolTo;
|
printToImpl = &printBoolTo;
|
||||||
content.asBool = value;
|
content.asBool = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set(long value)
|
void operator=(long value)
|
||||||
{
|
{
|
||||||
printToImpl = &printLongTo;
|
printToImpl = &printLongTo;
|
||||||
content.asLong = value;
|
content.asLong = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set(int value)
|
void operator=(int value)
|
||||||
{
|
{
|
||||||
printToImpl = &printLongTo;
|
printToImpl = &printLongTo;
|
||||||
content.asLong = value;
|
content.asLong = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set(Printable& value)
|
void operator=(Printable& value)
|
||||||
{
|
{
|
||||||
printToImpl = &printPrintableTo;
|
printToImpl = &printPrintableTo;
|
||||||
content.asPrintable = &value;
|
content.asPrintable = &value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set(const char* value)
|
void operator=(const char* value)
|
||||||
{
|
{
|
||||||
printToImpl = &printStringTo;
|
printToImpl = &printStringTo;
|
||||||
content.asString.set(value);
|
content.asString.set(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set(double value)
|
void operator=(double value)
|
||||||
{
|
{
|
||||||
set<2>(value);
|
set<2>(value);
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ namespace JsonGeneratorTests
|
|||||||
{
|
{
|
||||||
StringBuilder sb(buffer, sizeof(buffer));
|
StringBuilder sb(buffer, sizeof(buffer));
|
||||||
JsonValue jsonValue;
|
JsonValue jsonValue;
|
||||||
jsonValue.set(value);
|
jsonValue = value;
|
||||||
returnValue = jsonValue.printTo(sb);
|
returnValue = jsonValue.printTo(sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user