24 #include "blockcontext.h" 26 #include "exception.h" 28 #include "rendercontext.h" 32 IncludeNodeFactory::IncludeNodeFactory() {}
41 QStringLiteral(
"Error: Include tag takes only one argument"));
43 auto includeName = expr.at(1);
44 auto size = includeName.size();
56 :
Node(parent), m_filterExpression(fe)
66 auto t = ti->engine()->loadByName(filename);
70 TagSyntaxError, QStringLiteral(
"Template not found %1").arg(filename));
81 ConstantIncludeNode::ConstantIncludeNode(
const QString &name,
QObject *parent)
91 auto t = ti->engine()->loadByName(m_name);
94 TagSyntaxError, QStringLiteral(
"Template not found %1").arg(m_name));
106 auto nodes = t->findChildren<
BlockNode *>();
107 blockContext.remove(nodes);
Node * getNode(const QString &tagContent, Parser *p) const override
TemplateImpl * containerTemplate() const
The Context class holds the context to render a Template with.
RenderContext * renderContext() const
void render(OutputStream *stream, Context *c) const override
QVariant & data(const Node *const scopeNode)
Base class for all nodes.
Utility functions used throughout Cutelee.
The OutputStream class is used to render templates to a QTextStream.
void setValue(const T &value)
QVariant resolve(OutputStream *stream, Context *c) const
The Parser class processes a string template into a tree of nodes.
A FilterExpression object represents a filter expression in a template.
void render(OutputStream *stream, Context *c) const override
Q_INVOKABLE QStringList smartSplit(const QString &str) const
Cutelee::SafeString getSafeString(const QVariant &input)
An exception for use when implementing template tags.