21 #include "l10n_money.h" 23 #include "abstractlocalizer.h" 25 #include "exception.h" 30 L10nMoneyNodeFactory::L10nMoneyNodeFactory() {}
39 QStringLiteral(
"Error: l10n_money tag takes at least one argument"));
51 L10nMoneyVarNodeFactory::L10nMoneyVarNodeFactory() {}
62 QStringLiteral(
"Error: l10n_money tag takes at least three arguments"));
71 auto resultName = expr.last();
78 :
Node(parent), m_value(value), m_currency(currency)
84 auto resultString = c->
localizer()->localizeMonetaryValue(
94 :
Node(parent), m_value(value), m_currency(currency),
95 m_resultName(resultName)
102 auto resultString = c->
localizer()->localizeMonetaryValue(
106 c->
insert(m_resultName, resultString);
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 FilterExpression object represents a filter expression in a template.
Q_INVOKABLE QStringList smartSplit(const QString &str) const
void render(OutputStream *stream, Context *c) const override
void streamValueInContext(OutputStream *stream, const QVariant &input, Cutelee::Context *c) const
Node * getNode(const QString &tagContent, Parser *p) const override
void insert(const QString &name, QObject *object)
Cutelee::SafeString getSafeString(const QVariant &input)
An exception for use when implementing template tags.