mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-16 03:52:16 +02:00
Test that string can be stored in JsonObject
This commit is contained in:
@ -10,6 +10,14 @@ void JsonValue::operator=(bool value)
|
||||
_node->content.asBoolean = value;
|
||||
}
|
||||
|
||||
void JsonValue::operator=(char const* value)
|
||||
{
|
||||
if (!_node) return;
|
||||
|
||||
_node->type = JSON_STRING;
|
||||
_node->content.asString = value;
|
||||
}
|
||||
|
||||
void JsonValue::operator=(double value)
|
||||
{
|
||||
if (!_node) return;
|
||||
@ -33,6 +41,13 @@ JsonValue::operator bool()
|
||||
return _node->content.asBoolean;
|
||||
}
|
||||
|
||||
JsonValue::operator char const*()
|
||||
{
|
||||
if (!_node || _node->type != JSON_STRING) return 0;
|
||||
|
||||
return _node->content.asString;
|
||||
}
|
||||
|
||||
JsonValue::operator double()
|
||||
{
|
||||
if (!_node || _node->type < JSON_DOUBLE_0_DECIMALS) return 0;
|
||||
|
Reference in New Issue
Block a user