mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-06-25 01:11:35 +02:00
JsonString: move adapter class in the same file
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
#include <ArduinoJson/Strings/IsString.hpp>
|
||||
#include <ArduinoJson/Strings/JsonString.hpp>
|
||||
#include <ArduinoJson/Strings/StringAdapters.hpp>
|
||||
|
||||
#include <catch.hpp>
|
||||
|
@ -1,22 +0,0 @@
|
||||
// ArduinoJson - https://arduinojson.org
|
||||
// Copyright © 2014-2024, Benoit BLANCHON
|
||||
// MIT License
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ArduinoJson/Strings/Adapters/RamString.hpp>
|
||||
#include <ArduinoJson/Strings/JsonString.hpp>
|
||||
#include <ArduinoJson/Strings/StringAdapter.hpp>
|
||||
|
||||
ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
|
||||
|
||||
template <>
|
||||
struct StringAdapter<JsonString> {
|
||||
using AdaptedString = RamString;
|
||||
|
||||
static const AdaptedString& adapt(const JsonString& s) {
|
||||
return s.str_;
|
||||
}
|
||||
};
|
||||
|
||||
ARDUINOJSON_END_PRIVATE_NAMESPACE
|
@ -4,6 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ArduinoJson/Strings/Adapters/RamString.hpp>
|
||||
|
||||
#if ARDUINOJSON_ENABLE_STD_STREAM
|
||||
# include <ostream>
|
||||
#endif
|
||||
@ -81,4 +83,15 @@ class JsonString {
|
||||
detail::RamString str_;
|
||||
};
|
||||
|
||||
namespace detail {
|
||||
template <>
|
||||
struct StringAdapter<JsonString> {
|
||||
using AdaptedString = RamString;
|
||||
|
||||
static const AdaptedString& adapt(const JsonString& s) {
|
||||
return s.str_;
|
||||
}
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
ARDUINOJSON_END_PUBLIC_NAMESPACE
|
||||
|
@ -5,7 +5,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <ArduinoJson/Polyfills/type_traits.hpp>
|
||||
#include <ArduinoJson/Strings/Adapters/JsonString.hpp>
|
||||
#include <ArduinoJson/Strings/Adapters/RamString.hpp>
|
||||
#include <ArduinoJson/Strings/Adapters/StringObject.hpp>
|
||||
|
||||
|
Reference in New Issue
Block a user