Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
IDataSourceStream Class Referenceabstract

Base class for data source stream. More...

#include <DataSourceStream.h>

Inheritance diagram for IDataSourceStream:
ArduCAMStream FileStream MemoryDataStream TemplateFileStream JsonObjectStream

Public Member Functions

virtual StreamType getStreamType ()=0
 Get the stream type. More...
 
virtual uint16_t readMemoryBlock (char *data, int bufSize)=0
 Read a block of memory. More...
 
virtual bool seek (int len)=0
 Move read cursor. More...
 
virtual bool isFinished ()=0
 Check if stream is finished. More...
 

Detailed Description

Base class for data source stream.

Member Function Documentation

virtual StreamType IDataSourceStream::getStreamType ( )
pure virtual

Get the stream type.

Return values
StreamTypeThe stream type.
Todo:
Return value of IDataSourceStream:getStreamType base class function should be of type StreamType, e.g. eSST_User

Implemented in JsonObjectStream, TemplateFileStream, FileStream, MemoryDataStream, and ArduCAMStream.

virtual bool IDataSourceStream::isFinished ( )
pure virtual

Check if stream is finished.

Return values
boolTrue on success.

Implemented in FileStream, MemoryDataStream, and ArduCAMStream.

virtual uint16_t IDataSourceStream::readMemoryBlock ( char *  data,
int  bufSize 
)
pure virtual

Read a block of memory.

Parameters
dataPointer to the data to be read
bufSizeQuantity of chars to read
Return values
uint16_tQuantity of chars read
Todo:
Should IDataSourceStream::readMemoryBlock return same data type as its bufSize param?

Implemented in JsonObjectStream, TemplateFileStream, FileStream, MemoryDataStream, and ArduCAMStream.

virtual bool IDataSourceStream::seek ( int  len)
pure virtual

Move read cursor.

Parameters
lenPosition within stream to move cursor to
Return values
boolTrue on success.

Implemented in TemplateFileStream, FileStream, MemoryDataStream, and ArduCAMStream.