Rudiments
templateengine.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information
3
4#ifndef RUDIMENTS_TEMPLATEENGINE_H
5#define RUDIMENTS_TEMPLATEENGINE_H
6
7#include <rudiments/private/templateengineincludes.h>
8
9
11typedef bool (*fileparser_t)(output *out,
12 const char *filename,
13 void *data);
14
16typedef bool (*blockparser_t)(output *out,
17 const char *blockname,
18 const char *block,
19 uint64_t blocklength,
20 void *data);
21
22
25struct fileparser {
26 const char *file;
27 fileparser_t parser;
28 void *data;
29};
30
34 output *out;
35 const char *blockname;
36 blockparser_t parser;
37 void *data;
38};
39
42class RUDIMENTS_DLLSPEC templateengine : virtual public object {
43 public:
44
47
49 virtual ~templateengine();
50
58 void setVariableStart(const char *delimiter);
59
67 void setVariableEnd(const char *delimiter);
68
78
88
98
108
111
123 void setBlockStartStart(const char *delimiter);
124
136 void setBlockStartEnd(const char *delimiter);
137
149 void setBlockEndStart(const char *delimiter);
150
162 void setBlockEndEnd(const char *delimiter);
163
173 void setIncludeStart(const char *delimiter);
174
184 void setIncludeEnd(const char *delimiter);
185
193 const char *getVariableStart();
194
202 const char *getVariableEnd();
203
213
222 const char *getQuotedVariableEnd();
223
233
243
246
258 const char *getBlockStartStart();
259
271 const char *getBlockStartEnd();
272
284 const char *getBlockEndStart();
285
297 const char *getBlockEndEnd();
298
308 const char *getIncludeStart();
309
319 const char *getIncludeEnd();
320
329 bool parse(output *out,
330 const char *filename,
333
348 bool parse(output *out,
349 const char *filename,
352
367 bool parse(output *out,
368 const char *block,
372
375 const char *getError();
376
377 #include <rudiments/private/templateengine.h>
378};
379
380#endif
Definition avltree.h:11
Definition inttypes.h:63
Definition file.h:19
Definition object.h:10
Definition output.h:11
Definition templateengine.h:42
const char * getDoubleQuotedVariableEnd()
const char * getIncludeEnd()
const char * getBlockEndEnd()
const char * getBlockEndStart()
virtual ~templateengine()
void setVariableStart(const char *delimiter)
const char * getBlockStartEnd()
bool parse(output *out, const char *filename, blockparser *blockparsers, dictionary< const char *, const char * > *vars)
void setBlockStartStart(const char *delimiter)
void setQuotedVariableStart(const char *delimiter)
void setEscapeCharacter(char esc)
void setBlockStartEnd(const char *delimiter)
const char * getIncludeStart()
const char * getError()
const char * getQuotedVariableStart()
const char * getVariableEnd()
void setDoubleQuotedVariableEnd(const char *delimiter)
bool parse(output *out, const char *block, uint64_t blocklength, blockparser *blockparsers, dictionary< const char *, const char * > *vars)
void setIncludeEnd(const char *delimiter)
void setBlockEndStart(const char *delimiter)
void setBlockEndEnd(const char *delimiter)
void setQuotedVariableEnd(const char *delimiter)
bool parse(output *out, const char *filename, fileparser *fileparsers, dictionary< const char *, const char * > *vars)
char getEscapeCharacter()
const char * getVariableStart()
const char * getBlockStartStart()
void setDoubleQuotedVariableStart(const char *delimiter)
const char * getDoubleQuotedVariableStart()
const char * getQuotedVariableEnd()
void setVariableEnd(const char *delimiter)
void setIncludeStart(const char *delimiter)
Definition templateengine.h:33
Definition templateengine.h:25