Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
|
File stream class. More...
#include <DataSourceStream.h>
Public Member Functions | |
FileStream () | |
Create a file stream. More... | |
FileStream (String fileName) | |
virtual bool | attach (String fileName, FileOpenFlags openFlags) |
virtual StreamType | getStreamType () |
Get the stream type. More... | |
virtual size_t | write (uint8_t charToWrite) |
virtual size_t | write (const uint8_t *buffer, size_t size) |
virtual uint16_t | readMemoryBlock (char *data, int bufSize) |
Read a block of memory. More... | |
virtual bool | seek (int len) |
Move read cursor. More... | |
virtual bool | isFinished () |
Check if stream is finished. More... | |
String | fileName () |
Filename of file stream is attached to. More... | |
bool | fileExist () |
True if file exists. More... | |
int | getPos () |
Get the offset of cursor from beginning of data. More... | |
File stream class.
FileStream::FileStream | ( | ) |
Create a file stream.
fileName | Name of file to open |
bool FileStream::fileExist | ( | ) |
True if file exists.
String FileStream::fileName | ( | ) |
Filename of file stream is attached to.
|
inline |
Get the offset of cursor from beginning of data.
int | Cursor offset |
|
inlinevirtual |
Get the stream type.
StreamType | The stream type. |
Implements IDataSourceStream.
Reimplemented in TemplateFileStream.
|
virtual |
|
virtual |
Read a block of memory.
data | Pointer to the data to be read |
bufSize | Quantity of chars to read |
uint16_t | Quantity of chars read |
Implements IDataSourceStream.
Reimplemented in TemplateFileStream.
|
virtual |
Move read cursor.
len | Position within stream to move cursor to |
bool | True on success. |
Implements IDataSourceStream.
Reimplemented in TemplateFileStream.