mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Add as<JsonString>()
				
					
				
			This commit is contained in:
		| @@ -129,6 +129,18 @@ struct Converter<const char*> { | ||||
|   } | ||||
| }; | ||||
|  | ||||
| template <> | ||||
| struct Converter<String> { | ||||
|   static void toJson(String src, VariantRef dst) { | ||||
|     variantSetString(getData(dst), adaptString(src), getPool(dst)); | ||||
|   } | ||||
|  | ||||
|   static String fromJson(VariantConstRef src) { | ||||
|     const VariantData* data = getData(src); | ||||
|     return data ? String(data->asString(), false) : 0; | ||||
|   } | ||||
| }; | ||||
|  | ||||
| template <typename T> | ||||
| inline typename enable_if<IsString<T>::value, bool>::type convertToJson( | ||||
|     const T& src, VariantRef dst) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user