Rename undocumented JsonString::isLinked() to isStatic()

This commit is contained in:
Benoit Blanchon
2024-11-26 14:32:21 +01:00
parent ed5f890d28
commit e33e78d202
8 changed files with 26 additions and 25 deletions

View File

@@ -63,7 +63,7 @@ class FlashString {
::memcpy_P(p, s.str_, n);
}
bool isLinked() const {
bool isStatic() const {
return false;
}

View File

@@ -26,8 +26,8 @@ class RamString {
static constexpr size_t sizeMask = size_t(-1);
#endif
RamString(const char* str, size_t sz, bool linked = false)
: str_(str), size_(sz & sizeMask), linked_(linked) {
RamString(const char* str, size_t sz, bool isStatic = false)
: str_(str), size_(sz & sizeMask), static_(isStatic) {
ARDUINOJSON_ASSERT(size_ == sz);
}
@@ -49,8 +49,8 @@ class RamString {
return str_;
}
bool isLinked() const {
return linked_;
bool isStatic() const {
return static_;
}
protected:
@@ -59,10 +59,10 @@ class RamString {
#if ARDUINOJSON_SIZEOF_POINTER <= 2
// Use a bitfield only on 8-bit microcontrollers
size_t size_ : sizeof(size_t) * 8 - 1;
bool linked_ : 1;
bool static_ : 1;
#else
size_t size_;
bool linked_;
bool static_;
#endif
};

View File

@@ -42,8 +42,8 @@ class JsonString {
// Returns true if the string is stored by address.
// Returns false if the string is stored by copy.
bool isLinked() const {
return str_.isLinked();
bool isStatic() const {
return str_.isStatic();
}
// Returns length of the string.

View File

@@ -26,7 +26,7 @@ inline bool VariantData::setString(TAdaptedString value,
if (value.isNull())
return false;
if (value.isLinked()) {
if (value.isStatic()) {
setLinkedString(value.data());
return true;
}