mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Separate string adapter from storage policy
This commit is contained in:
20
src/ArduinoJson/Strings/Adapters/JsonString.hpp
Normal file
20
src/ArduinoJson/Strings/Adapters/JsonString.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2021
|
||||
// MIT License
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ArduinoJson/Strings/Adapters/RamString.hpp>
|
||||
#include <ArduinoJson/Strings/IsString.hpp>
|
||||
#include <ArduinoJson/Strings/String.hpp>
|
||||
|
||||
namespace ARDUINOJSON_NAMESPACE {
|
||||
|
||||
inline SizedRamString adaptString(const String& s) {
|
||||
return SizedRamString(s.c_str(), s.size());
|
||||
}
|
||||
|
||||
template <>
|
||||
struct IsString<String> : true_type {};
|
||||
|
||||
} // namespace ARDUINOJSON_NAMESPACE
|
||||
Reference in New Issue
Block a user