mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Fix call of overloaded 'String(const char*, int)' is ambiguous
This commit is contained in:
@@ -73,9 +73,11 @@ inline T VariantData::asFloat() const {
|
||||
inline String VariantData::asString() const {
|
||||
switch (type()) {
|
||||
case VALUE_IS_LINKED_STRING:
|
||||
return String(_content.asString.data, _content.asString.size, true);
|
||||
return String(_content.asString.data, _content.asString.size,
|
||||
String::Linked);
|
||||
case VALUE_IS_OWNED_STRING:
|
||||
return String(_content.asString.data, _content.asString.size, false);
|
||||
return String(_content.asString.data, _content.asString.size,
|
||||
String::Copied);
|
||||
default:
|
||||
return String();
|
||||
}
|
||||
@@ -174,7 +176,7 @@ template <typename TAdaptedString, typename TCallback>
|
||||
bool CopyStringStoragePolicy::store(TAdaptedString str, MemoryPool *pool,
|
||||
TCallback callback) {
|
||||
const char *copy = pool->saveString(str);
|
||||
String storedString(copy, str.size(), false);
|
||||
String storedString(copy, str.size(), String::Copied);
|
||||
callback(storedString);
|
||||
return copy != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user