FactDev
0.1
|
#include <mustache.h>
Public Member Functions | |
QString | render (const QString &_template, Context *context) |
QString | error () const |
int | errorPos () const |
QString | errorPartial () const |
void | setTagMarkers (const QString &startMarker, const QString &endMarker) |
Renders Mustache templates, replacing mustache tags with values from a provided context.
QString Renderer::error | ( | ) | const |
Returns a message describing the last error encountered by the previous render() call.
QString Renderer::errorPartial | ( | ) | const |
Returns the name of the partial where the error occurred, or an empty string if the error occurred in the main template.
int Renderer::errorPos | ( | ) | const |
Returns the position in the template where the last error occurred when rendering the template or -1 if no error occurred.
If the error occurred in a partial template, the returned position is the offset in the partial template.
QString Renderer::render | ( | const QString & | _template, |
Context * | context | ||
) |
Render a Mustache template, using context
to fetch the values used to replace Mustache tags.
void Renderer::setTagMarkers | ( | const QString & | startMarker, |
const QString & | endMarker | ||
) |
Sets the default tag start and end markers. This can be overridden within a template.