mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			774 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			774 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| // ArduinoJson - https://arduinojson.org
 | |
| // Copyright © 2014-2022, Benoit BLANCHON
 | |
| // MIT License
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <ArduinoJson/Strings/Adapters/RamString.hpp>
 | |
| #include <ArduinoJson/Strings/IsString.hpp>
 | |
| #include <ArduinoJson/Strings/String.hpp>
 | |
| 
 | |
| namespace ARDUINOJSON_NAMESPACE {
 | |
| 
 | |
| class JsonStringAdapter : public SizedRamString {
 | |
|  public:
 | |
|   JsonStringAdapter(const String& s)
 | |
|       : SizedRamString(s.c_str(), s.size()), _linked(s.isLinked()) {}
 | |
| 
 | |
|   LinkOrCopyStringStoragePolicy storagePolicy() {
 | |
|     return LinkOrCopyStringStoragePolicy(_linked);
 | |
|   }
 | |
| 
 | |
|  private:
 | |
|   bool _linked;
 | |
| };
 | |
| 
 | |
| inline JsonStringAdapter adaptString(const String& s) {
 | |
|   return JsonStringAdapter(s);
 | |
| }
 | |
| 
 | |
| template <>
 | |
| struct IsString<String> : true_type {};
 | |
| 
 | |
| }  // namespace ARDUINOJSON_NAMESPACE
 |