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> 36 #include <QtCore/QSet> 37 #include <QtCore/QVector> 82 class GRANTLEE_TEMPLATES_EXPORT
Node :
public QObject
91 explicit Node(QObject *parent = {});
109 virtual bool mustBeFirst()
122 void streamValueInContext(
OutputStream *stream,
const QVariant &input,
128 TemplateImpl *containerTemplate()
const;
131 Q_DECLARE_PRIVATE(
Node)
132 NodePrivate *
const d_ptr;
152 class GRANTLEE_TEMPLATES_EXPORT
NodeList :
public QList<Grantlee::Node *>
170 NodeList(
const QList<Grantlee::Node *> &list);
185 void append(QList<Grantlee::Node *> nodeList);
190 bool containsNonText()
const;
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;
220 class AbstractNodeFactoryPrivate;
334 virtual Node *getNode(
const QString &tagContent,
Parser *p)
const = 0;
343 virtual void setEngine(
Engine *) {}
362 Q_INVOKABLE QStringList smartSplit(
const QString &str)
const;
371 QList<FilterExpression> getFilterExpressionList(
const QStringList &list,
376 AbstractNodeFactoryPrivate *
const d_ptr;
The Context class holds the context to render a Template with.
The Parser class processes a string template into a tree of nodes.
Base class for all nodes.
A list of Nodes with some convenience API for rendering them.
QList< T > findChildren()
The OutputStream class is used to render templates to a QTextStream.
Base class for all NodeFactories.
The Grantlee namespace holds all public Grantlee API.
Grantlee::Engine is the main entry point for creating Grantlee Templates.