SectionStream.h
Go to the documentation of this file.
65 SectionStream(IDataSourceStream* source, uint8_t maxSections, const String& startTag, const String& endTag)
#define F(string_literal)
Wrap a string literal stored in flash and access it using a String object.
Definition: WString.h:113
Presents each section within a source stream as a separate stream.
Definition: SectionStream.h:26
Delegate< bool()> NextRecord
Application callback to move to next record.
Definition: SectionStream.h:49
int seekFrom(int offset, SeekOrigin origin) override
Change position in stream.
Delegate< void()> NextSection
Application notification callback when section changes.
Definition: SectionStream.h:43
SectionStream(IDataSourceStream *source, uint8_t maxSections=5)
Construct a section stream with default options.
Definition: SectionStream.h:54
SectionStream(IDataSourceStream *source, uint8_t maxSections, const String &startTag, const String &endTag)
Construct a section stream.
Definition: SectionStream.h:65
const Section * getSection() const
Get description of the current section.
Definition: SectionStream.h:109
const Section * getSection(unsigned index) const
Get description for any section given its index.
Definition: SectionStream.h:118
uint16_t readMemoryBlock(char *data, int bufSize) override
Read a block of memory.
virtual bool nextRecord()
Move to first/next record.
Definition: SectionStream.h:170
size_t count() const
Get number of sections in this stream.
Definition: SectionStream.h:100
bool setNewSection(int8_t index)
Goto a new section after current tag has been processed.
Definition: SectionStream.h:151
void onNextSection(NextSection callback)
Register a callback to be invoked when moving to a new section.
Definition: SectionStream.h:130
int available() override
Return the total length of the stream.
Definition: SectionStream.h:72
bool isFinished() override
Check if all data has been read.
Definition: SectionStream.h:81
void onNextRecord(NextRecord callback)
Register a callback to be invoked when moving to a new record.
Definition: SectionStream.h:138
Definition: SectionStream.h:28