mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-02 16:14:19 +01:00
Extracted storage_policy to improve coverage in string adapters
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <ArduinoJson/Polyfills/pgmspace.hpp>
|
||||
#include <ArduinoJson/Strings/StoragePolicy.hpp>
|
||||
|
||||
namespace ARDUINOJSON_NAMESPACE {
|
||||
|
||||
@@ -40,19 +41,13 @@ class FlashStringAdapter {
|
||||
return dup;
|
||||
}
|
||||
|
||||
const char* data() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t size() const {
|
||||
if (!_str)
|
||||
return 0;
|
||||
return strlen_P(reinterpret_cast<const char*>(_str));
|
||||
}
|
||||
|
||||
bool isStatic() const {
|
||||
return false;
|
||||
}
|
||||
typedef storage_policy::store_by_copy storage_policy;
|
||||
|
||||
private:
|
||||
const __FlashStringHelper* _str;
|
||||
|
||||
Reference in New Issue
Block a user