11 #ifndef _SMING_CORE_DATA_STREAM_TEMPLATE_STREAM_H_ 12 #define _SMING_CORE_DATA_STREAM_TEMPLATE_STREAM_H_ 14 #include "DataSourceStream.h" 18 #define TEMPLATE_MAX_VAR_NAME_LEN 16 52 varName.reserve(TEMPLATE_MAX_VAR_NAME_LEN);
67 uint16_t readMemoryBlock(
char* data,
int bufSize)
override;
70 bool seek(
int len)
override;
74 return stream ? stream->isFinished() :
true;
84 templateData[name] = value;
92 templateData.setMultiple(vars);
105 return stream ? stream->getName() :
nullptr;
122 size_t skipBlockSize = 0;
123 size_t varDataPos = 0;
124 size_t varWaitSize = 0;
Template expand state sending variable.
Definition: TemplateStream.h:35
Template expand state found.
Definition: TemplateStream.h:33
Definition: WHashMap.h:35
StreamType getStreamType() const override
Get the stream type.
Definition: TemplateStream.h:61
Base class for data source stream.
Definition: DataSourceStream.h:39
String getName() const override
Returns name of the resource.
Definition: TemplateStream.h:103
Template expand state start variable.
Definition: TemplateStream.h:34
bool isFinished() override
Check if all data has been read.
Definition: TemplateStream.h:72
The string class.
Definition: WString.h:104
Template expand state wait.
Definition: TemplateStream.h:32
TemplateStream(IDataSourceStream *stream)
Create a template stream.
Definition: TemplateStream.h:49
Definition: TemplateStream.h:43
TemplateExpandState
Template file stream expand state.
Definition: TemplateStream.h:31
TemplateVariables & variables()
Get the template variables.
Definition: TemplateStream.h:98
StreamType
Data stream type.
Definition: DataSourceStream.h:22
Template data stream.
Definition: DataSourceStream.h:26
Template variable (hash map) class.
Definition: TemplateStream.h:23
Stream content not valid.
Definition: DataSourceStream.h:23
void setVars(const TemplateVariables &vars)
Set multiple variables in the template file.
Definition: TemplateStream.h:90
void setVar(const String &name, const String &value)
Set value of a variable in the template file.
Definition: TemplateStream.h:82