Replace CopiedString and LinkedString with JsonString

This commit is contained in:
Benoit Blanchon
2022-01-13 16:15:53 +01:00
parent 973858b835
commit 4f6244eef4
11 changed files with 26 additions and 76 deletions

View File

@@ -5,7 +5,6 @@
#pragma once
#include <ArduinoJson/Memory/MemoryPool.hpp>
#include <ArduinoJson/Strings/StoredString.hpp>
#include <ArduinoJson/Strings/String.hpp>
namespace ARDUINOJSON_NAMESPACE {
@@ -13,15 +12,13 @@ namespace ARDUINOJSON_NAMESPACE {
struct LinkStringStoragePolicy {
template <typename TAdaptedString, typename TCallback>
bool store(TAdaptedString str, MemoryPool *, TCallback callback) {
LinkedString storedString(str.data(), str.size());
String storedString(str.data(), str.size(), true);
callback(storedString);
return !str.isNull();
}
};
struct CopyStringStoragePolicy {
typedef CopiedString TResult;
template <typename TAdaptedString, typename TCallback>
bool store(TAdaptedString str, MemoryPool *pool, TCallback callback);
};