21 #include "with_locale.h" 23 #include "../lib/exception.h" 28 #include <abstractlocalizer.h> 30 WithLocaleNodeFactory::WithLocaleNodeFactory() {}
36 if (expr.size() != 2) {
40 "%1 expected format is for example 'with_locale \"de_DE\"'")
47 auto nodeList = p->
parse(n, QStringLiteral(
"endwith_locale"));
48 n->setNodeList(nodeList);
56 :
Node(parent), m_localeName(localeName)
60 void WithLocaleNode::setNodeList(
const NodeList &nodeList)
NodeList parse(Node *parent, const QStringList &stopAt={})
The Context class holds the context to render a Template with.
Node * getNode(const QString &tagContent, Parser *p) const override
Base class for all nodes.
Utility functions used throughout Cutelee.
The OutputStream class is used to render templates to a QTextStream.
void render(OutputStream *stream, Context *c) const override
QVariant resolve(OutputStream *stream, Context *c) const
std::shared_ptr< AbstractLocalizer > localizer() const
The Parser class processes a string template into a tree of nodes.
A list of Nodes with some convenience API for rendering them.
A FilterExpression object represents a filter expression in a template.
Q_INVOKABLE QStringList smartSplit(const QString &str) const
Cutelee::SafeString getSafeString(const QVariant &input)
void render(OutputStream *stream, Context *c) const
An exception for use when implementing template tags.