templateengine.h
// Copyright (c) 1999-2018 David Muse
// See the COPYING file for more information
#ifndef RUDIMENTS_TEMPLATEENGINE_H
#define RUDIMENTS_TEMPLATEENGINE_H
#include <rudiments/private/templateengineincludes.h>
typedef bool (*fileparser_t)(output *out,
const char *filename,
void *data);
typedef bool (*blockparser_t)(output *out,
const char *blockname,
const char *block,
uint64_t blocklength,
void *data);
struct fileparser {
const char *file;
fileparser_t parser;
void *data;
};
struct blockparser {
output *out;
const char *blockname;
blockparser_t parser;
void *data;
};
class RUDIMENTS_DLLSPEC templateengine {
public:
templateengine();
virtual ~templateengine();
bool parse(output *out,
const char *filename,
fileparser *fileparsers,
dictionary< const char *, const char * > *vars);
bool parse(output *out,
const char *filename,
blockparser *blockparsers,
dictionary< const char *, const char * > *vars);
bool parse(output *out,
const char *block,
uint64_t blocklength,
blockparser *blockparsers,
dictionary< const char *, const char * > *vars);
void setVariableStart(const char *delimiter);
void setVariableEnd(const char *delimiter);
void setQuotedVariableStart(const char *delimiter);
void setQuotedVariableEnd(const char *delimiter);
void setDoubleQuotedVariableStart(const char *delimiter);
void setDoubleQuotedVariableEnd(const char *delimiter);
void setEscapeCharacter(char esc);
void setBlockStartStart(const char *delimiter);
void setBlockStartEnd(const char *delimiter);
void setBlockEndStart(const char *delimiter);
void setBlockEndEnd(const char *delimiter);
void setIncludeStart(const char *delimiter);
void setIncludeEnd(const char *delimiter);
const char *getVariableStart();
const char *getVariableEnd();
const char *getQuotedVariableStart();
const char *getQuotedVariableEnd();
const char *getDoubleQuotedVariableStart();
const char *getDoubleQuotedVariableEnd();
char getEscapeCharacter();
const char *getBlockStartStart();
const char *getBlockStartEnd();
const char *getBlockEndStart();
const char *getBlockEndEnd();
const char *getIncludeStart();
const char *getIncludeEnd();
const char *getError();
#include <rudiments/private/templateengine.h>
};
#endif
bool
Definition: inttypes.h:92
dictionary
Definition: dictionary.h:63
file
Definition: file.h:19
output
Definition: output.h:9
templateengine
Definition: templateengine.h:42
templateengine::getBlockEndEnd
const char * getBlockEndEnd()
templateengine::templateengine
templateengine()
templateengine::getIncludeEnd
const char * getIncludeEnd()
templateengine::getBlockStartEnd
const char * getBlockStartEnd()
templateengine::getBlockStartStart
const char * getBlockStartStart()
templateengine::~templateengine
virtual ~templateengine()
templateengine::setVariableStart
void setVariableStart(const char *delimiter)
templateengine::parse
bool parse(output *out, const char *filename, blockparser *blockparsers, dictionary< const char *, const char * > *vars)
templateengine::setBlockStartStart
void setBlockStartStart(const char *delimiter)
templateengine::setQuotedVariableStart
void setQuotedVariableStart(const char *delimiter)
templateengine::getQuotedVariableEnd
const char * getQuotedVariableEnd()
templateengine::setEscapeCharacter
void setEscapeCharacter(char esc)
templateengine::setBlockStartEnd
void setBlockStartEnd(const char *delimiter)
templateengine::getIncludeStart
const char * getIncludeStart()
templateengine::getQuotedVariableStart
const char * getQuotedVariableStart()
templateengine::setDoubleQuotedVariableEnd
void setDoubleQuotedVariableEnd(const char *delimiter)
templateengine::parse
bool parse(output *out, const char *block, uint64_t blocklength, blockparser *blockparsers, dictionary< const char *, const char * > *vars)
templateengine::getBlockEndStart
const char * getBlockEndStart()
templateengine::setIncludeEnd
void setIncludeEnd(const char *delimiter)
templateengine::setBlockEndStart
void setBlockEndStart(const char *delimiter)
templateengine::setBlockEndEnd
void setBlockEndEnd(const char *delimiter)
templateengine::setQuotedVariableEnd
void setQuotedVariableEnd(const char *delimiter)
templateengine::parse
bool parse(output *out, const char *filename, fileparser *fileparsers, dictionary< const char *, const char * > *vars)
templateengine::getEscapeCharacter
char getEscapeCharacter()
templateengine::getVariableEnd
const char * getVariableEnd()
templateengine::setDoubleQuotedVariableStart
void setDoubleQuotedVariableStart(const char *delimiter)
templateengine::getError
const char * getError()
templateengine::getVariableStart
const char * getVariableStart()
templateengine::getDoubleQuotedVariableStart
const char * getDoubleQuotedVariableStart()
templateengine::getDoubleQuotedVariableEnd
const char * getDoubleQuotedVariableEnd()
templateengine::setVariableEnd
void setVariableEnd(const char *delimiter)
templateengine::setIncludeStart
void setIncludeStart(const char *delimiter)
blockparser
Definition: templateengine.h:33
fileparser
Definition: templateengine.h:25