Object.hpp
Go to the documentation of this file.
49 #define DEFINE_FSTR_REF(name, ObjectType, object) const ObjectType& name PROGMEM = object.template as<ObjectType>();
51 #define DEFINE_FSTR_REF_NAMED(name, ObjectType) DEFINE_FSTR_REF(name, ObjectType, FSTR_DATA_NAME(name).object);
82 #define FSTR_PTR(objref) static_cast<std::remove_reference<decltype(objref)>::type*>(&FSTR_DATA_NAME(objref).object)
89 static_assert(offsetof(decltype(name), data) == sizeof(uint32_t), "FSTR structure alignment error");
143 Object(const Object& obj) : ObjectBase{obj.isCopy() ? obj.flashLength_ : uint32_t(&obj) | copyBit}
#define isFlashPtr(ptr)
Simple check to determine if a pointer refers to flash memory.
Definition: Arch/Esp32/Components/libc/src/include/sys/pgmspace.h:24
constexpr FSTR_NOINLINE const size_t length() const
Get the length of the object data in bytes.
Definition: ObjectBase.hpp:38
size_t read(size_t offset, void *buffer, size_t count) const
Read contents of a String into RAM.
constexpr const ObjectType & as() const
Cast to a different object type.
Definition: ObjectBase.hpp:66
static constexpr uint32_t copyBit
Set to indicate copy.
Definition: ObjectBase.hpp:122
static constexpr uint32_t lengthInvalid
Indicates null string in a copy.
Definition: ObjectBase.hpp:123
size_t readFlash(size_t offset, void *buffer, size_t count) const
Read contents of a String into RAM, using flashread()
Definition: ObjectIterator.hpp:29
size_t readFlash(size_t index, ElementType *buffer, size_t count) const
Read content into RAM,using flashmem_read()
Definition: Object.hpp:231
constexpr const size_t length() const
Get the length of the content in elements.
Definition: Object.hpp:168
size_t read(size_t index, ElementType *buffer, size_t count) const
Read content into RAM.
Definition: Object.hpp:217
ElementType operator[](unsigned index) const
Array operator[].
Definition: Object.hpp:195
ElementType unsafeValueAt(const DataPtrType dataptr, unsigned index) const
Definition: Object.hpp:238
static constexpr const ObjectType & empty()
Return an empty object which evaluates to null.
Definition: Object.hpp:160
Definition: Array.hpp:108
std::enable_if< sizeof(T)==1, T >::type readValue(const T *ptr)
Read a typed value from flash memory ensuring correct alignment of access.
Definition: Utility.hpp:126
ObjectType
Definition: Libraries/jerryscript/src/include/Jerryscript/Types.h:34