Class to access a Vector of objects stored in flash.
More...
#include <Vector.hpp>
|
template<typename ValueType , typename T = ObjectType> |
std::enable_if< std::is_same< T, String >::value, int >::type | indexOf (const ValueType &value, bool ignoreCase=true) const |
|
const ObjectType & | valueAt (unsigned index) const |
|
const ObjectType & | operator[] (unsigned index) const |
|
ArrayPrinter< Vector > | printer () const |
|
size_t | printTo (Print &p) const |
|
Iterator | begin () const |
|
Iterator | end () const |
|
size_t | length () const |
| Get the length of the content in elements. More...
|
|
int | indexOf (const ValueType &value) const |
|
size_t | elementSize () const |
|
const ObjectType * * | data () const |
|
size_t | read (size_t index, ObjectType * *buffer, size_t count) const |
| Read content into RAM. More...
|
|
size_t | read (size_t offset, void *buffer, size_t count) const |
| Read contents of a String into RAM. More...
|
|
size_t | readFlash (size_t index, ObjectType * *buffer, size_t count) const |
| Read content into RAM,using flashmem_read() More...
|
|
size_t | readFlash (size_t offset, void *buffer, size_t count) const |
| Read contents of a String into RAM, using flashread() More...
|
|
size_t | size () const |
| Get the object data size in bytes. More...
|
|
template<class ObjectType > |
constexpr const ObjectType & | as () const |
| Cast to a different object type. More...
|
|
bool | isCopy () const |
|
bool | isNull () const |
| Indicates an invalid String, used for return value from lookups, etc. More...
|
|
|
static const Vector< ObjectType > & | empty () |
| Return an empty object which evaluates to null. More...
|
|
template<class ObjectType>
class FSTR::Vector< ObjectType >
Class to access a Vector of objects stored in flash.
- Template Parameters
-
◆ Iterator
◆ as()
template<class ObjectType >
constexpr const ObjectType& FSTR::ObjectBase::as |
( |
| ) |
const |
|
inlineinherited |
Cast to a different object type.
- Note
- example:
fstr.as<Array<int>>();
◆ begin()
◆ copy()
void FSTR::ObjectBase::copy |
( |
const ObjectBase & |
obj | ) |
|
|
inlineprotectedinherited |
◆ data()
◆ elementSize()
◆ empty()
Return an empty object which evaluates to null.
◆ end()
◆ indexOf() [1/2]
template<class ObjectType >
template<typename ValueType , typename T = ObjectType>
std::enable_if<std::is_same<T, String>::value, int>::type FSTR::Vector< ObjectType >::indexOf |
( |
const ValueType & |
value, |
|
|
bool |
ignoreCase = true |
|
) |
| const |
|
inline |
◆ indexOf() [2/2]
◆ invalidate()
void FSTR::ObjectBase::invalidate |
( |
| ) |
|
|
protectedinherited |
◆ isCopy()
bool FSTR::ObjectBase::isCopy |
( |
| ) |
const |
|
inlineinherited |
◆ isNull()
bool FSTR::ObjectBase::isNull |
( |
| ) |
const |
|
inlineinherited |
Indicates an invalid String, used for return value from lookups, etc.
- Note
- A real String can be zero-length, but it cannot be null
◆ length()
Get the length of the content in elements.
◆ operator[]()
template<class ObjectType >
const ObjectType& FSTR::Vector< ObjectType >::operator[] |
( |
unsigned |
index | ) |
const |
|
inline |
◆ printer()
template<class ObjectType >
◆ printTo()
template<class ObjectType >
◆ read() [1/2]
size_t FSTR::ObjectBase::read |
( |
size_t |
offset, |
|
|
void * |
buffer, |
|
|
size_t |
count |
|
) |
| const |
|
inlineinherited |
Read contents of a String into RAM.
- Parameters
-
offset | Zero-based offset from start of flash data to start reading |
buffer | Where to store data |
count | How many bytes to read |
- Return values
-
size_t | Number of bytes actually read |
◆ read() [2/2]
size_t FSTR::Object< Vector< ObjectType > , ObjectType * >::read |
( |
size_t |
index, |
|
|
ObjectType * * |
buffer, |
|
|
size_t |
count |
|
) |
| const |
|
inlineinherited |
Read content into RAM.
- Parameters
-
index | First element to read |
buffer | Where to store data |
count | How many elements to read |
- Return values
-
size_t | Number of elements actually read |
◆ readFlash() [1/2]
size_t FSTR::ObjectBase::readFlash |
( |
size_t |
offset, |
|
|
void * |
buffer, |
|
|
size_t |
count |
|
) |
| const |
|
inherited |
Read contents of a String into RAM, using flashread()
- Parameters
-
offset | Zero-based offset from start of flash data to start reading |
buffer | Where to store data |
count | How many bytes to read |
- Return values
-
size_t | Number of bytes actually read |
- See also
- See also
FlashMemoryStream
class.
PROGMEM data is accessed via the CPU data cache, so to avoid degrading performance you can use this method to read data directly from flash memory. This is appropriate for infrequently accessed data, especially if it is large. For example, if storing content using IMPORT_FSTR
instead of SPIFFS then it is generally better to avoid contaminating the cache.
◆ readFlash() [2/2]
size_t FSTR::Object< Vector< ObjectType > , ObjectType * >::readFlash |
( |
size_t |
index, |
|
|
ObjectType * * |
buffer, |
|
|
size_t |
count |
|
) |
| const |
|
inlineinherited |
Read content into RAM,using flashmem_read()
- Parameters
-
index | First element to read |
buffer | Where to store data |
count | How many elements to read |
- Return values
-
size_t | Number of elements actually read |
◆ size()
size_t FSTR::ObjectBase::size |
( |
| ) |
const |
|
inlineinherited |
Get the object data size in bytes.
- Note
- Always an integer multiple of 4 bytes
◆ valueAt()
template<class ObjectType >
const ObjectType& FSTR::Vector< ObjectType >::valueAt |
( |
unsigned |
index | ) |
const |
|
inline |
◆ empty_
◆ flashLength_
uint32_t FSTR::ObjectBase::flashLength_ |
|
inherited |
The documentation for this class was generated from the following file: