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 = 0);
109 virtual bool mustBeFirst()
123 void streamValueInContext(
OutputStream *stream,
const QVariant &input,
129 TemplateImpl *containerTemplate()
const;
132 Q_DECLARE_PRIVATE(
Node)
133 NodePrivate *
const d_ptr;
154 class GRANTLEE_TEMPLATES_EXPORT
NodeList :
public QList<Grantlee::Node *>
172 NodeList(
const QList<Grantlee::Node *> &list);
187 void append(QList<Grantlee::Node *> nodeList);
192 bool containsNonText()
const;
200 QList<Grantlee::Node *>::const_iterator it;
201 const QList<Grantlee::Node *>::const_iterator first = constBegin();
202 const QList<Grantlee::Node *>::const_iterator last = constEnd();
203 for (it = first; it != last; ++it) {
204 T
object = qobject_cast<T>(*it);
208 children << (*it)->findChildren<T>();
219 bool m_containsNonText;
222 class AbstractNodeFactoryPrivate;
337 virtual Node *getNode(
const QString &tagContent,
Parser *p)
const = 0;
346 virtual void setEngine(
Engine *) {}
365 Q_INVOKABLE QStringList smartSplit(
const QString &str)
const;
374 QList<FilterExpression> getFilterExpressionList(
const QStringList &list,
379 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.