21#ifndef GRANTLEE_NODE_H
22#define GRANTLEE_NODE_H
27#include "filterexpression.h"
28#include "grantlee_templates_export.h"
29#include "outputstream.h"
30#include "safestring.h"
32#include <QtCore/QStringList>
37#include <QtCore/QVector>
82class GRANTLEE_TEMPLATES_EXPORT
Node :
public QObject
91 explicit Node(QObject *parent = {});
109 virtual bool mustBeFirst()
131 Q_DECLARE_PRIVATE(
Node)
132 NodePrivate *
const d_ptr;
152class GRANTLEE_TEMPLATES_EXPORT
NodeList :
public QList<Grantlee::Node *>
185 void append(QList<Grantlee::Node *> nodeList);
198 QList<Grantlee::Node *>::const_iterator it;
199 const QList<Grantlee::Node *>::const_iterator first = constBegin();
200 const QList<Grantlee::Node *>::const_iterator last = constEnd();
201 for (it = first; it != last; ++it) {
202 T
object = qobject_cast<T>(*it);
206 children << (*it)->findChildren<T>();
217 bool m_containsNonText;
220class AbstractNodeFactoryPrivate;
343 virtual void setEngine(
Engine *) {}
362 Q_INVOKABLE QStringList
smartSplit(
const QString &str)
const;
376 AbstractNodeFactoryPrivate *
const d_ptr;
virtual Node * getNode(const QString &tagContent, Parser *p) const =0
QList< FilterExpression > getFilterExpressionList(const QStringList &list, Parser *p) const
Q_INVOKABLE QStringList smartSplit(const QString &str) const
AbstractNodeFactory(QObject *parent={})
~AbstractNodeFactory() override
The Context class holds the context to render a Template with.
Grantlee::Engine is the main entry point for creating Grantlee Templates.
A list of Nodes with some convenience API for rendering them.
void append(Grantlee::Node *node)
void render(OutputStream *stream, Context *c) const
QList< T > findChildren()
bool containsNonText() const
NodeList(const NodeList &list)
void append(QList< Grantlee::Node * > nodeList)
NodeList(const QList< Grantlee::Node * > &list)
Base class for all nodes.
virtual void render(OutputStream *stream, Context *c) const =0
TemplateImpl * containerTemplate() const
void streamValueInContext(OutputStream *stream, const QVariant &input, Grantlee::Context *c) const
The OutputStream class is used to render templates to a QTextStream.
The Parser class processes a string template into a tree of nodes.
The Grantlee namespace holds all public Grantlee API.