8 #ifndef _SMING_CORE_DATASTREAM_H_ 9 #define _SMING_CORE_DATASTREAM_H_ 11 #include <user_config.h> 12 #include "../SmingCore/FileSystem.h" 13 #include "../Services/ArduinoJson/include/ArduinoJson.h" 14 #include "../Wiring/WString.h" 15 #include "../Wiring/WHashMap.h" 17 #define TEMPLATE_MAX_VAR_NAME_LEN 16 66 virtual uint16_t readMemoryBlock(
char* data,
int bufSize) = 0;
72 virtual bool seek(
int len) = 0;
77 virtual bool isFinished() = 0;
106 virtual size_t write(uint8_t charToWrite);
113 virtual size_t write(
const uint8_t *buffer,
size_t size);
116 virtual uint16_t readMemoryBlock(
char* data,
int bufSize);
119 virtual bool seek(
int len);
122 virtual bool isFinished();
147 virtual size_t write(uint8_t charToWrite);
148 virtual size_t write(
const uint8_t *buffer,
size_t size);
151 virtual uint16_t readMemoryBlock(
char* data,
int bufSize);
154 virtual bool seek(
int len);
157 virtual bool isFinished();
205 virtual uint16_t readMemoryBlock(
char* data,
int bufSize);
208 virtual bool seek(
int len);
220 void setVarsFromRequest(
const HttpRequest& request);
251 JsonObject& getRoot();
254 virtual uint16_t readMemoryBlock(
char* data,
int bufSize);
257 DynamicJsonBuffer buffer;
258 JsonObject &rootNode;
bool fileExist(const String name)
Check if a file exists on file system.
Template expand state sending variable.
Definition: DataSourceStream.h:183
Template file stream class.
Definition: DataSourceStream.h:192
Template expand state found.
Definition: DataSourceStream.h:181
Definition: WHashMap.h:24
Template file data stream.
Definition: DataSourceStream.h:29
Memory data stream.
Definition: DataSourceStream.h:27
Base class for data source stream.
Definition: DataSourceStream.h:49
virtual StreamType getStreamType()
Get the stream type.
Definition: DataSourceStream.h:202
Template expand state start variable.
Definition: DataSourceStream.h:182
JSON object stream class.
Definition: DataSourceStream.h:237
JSON object data stream.
Definition: DataSourceStream.h:30
Provides formatted output to stream.
Definition: Print.h:31
Template expand state wait.
Definition: DataSourceStream.h:180
File stream class.
Definition: DataSourceStream.h:132
const char * getStreamPointer()
Get a pointer to the current position.
Definition: DataSourceStream.h:95
virtual StreamType getStreamType()
Get the stream type.
Definition: DataSourceStream.h:90
TemplateExpandState
Template file stream expand state.
Definition: DataSourceStream.h:178
Unknown data stream type.
Definition: DataSourceStream.h:32
StreamType
Data stream type.
Definition: DataSourceStream.h:25
File data stream.
Definition: DataSourceStream.h:28
Template variable (hash map) class.
Definition: DataSourceStream.h:44
virtual StreamType getStreamType()
Get the stream type.
Definition: DataSourceStream.h:246
Definition: HttpRequest.h:27
TemplateVariables & variables()
Get the template variables.
Definition: DataSourceStream.h:225
virtual StreamType getStreamType()
Get the stream type.
Definition: DataSourceStream.h:145
User defined data stream.
Definition: DataSourceStream.h:31
int getStreamLength()
Get size of stream.
Definition: DataSourceStream.h:100
int getPos()
Get the offset of cursor from beginning of data.
Definition: DataSourceStream.h:165
FileOpenFlags
File open flags.
Definition: FileSystem.h:22
Memory data stream class.
Definition: DataSourceStream.h:81