21 #ifndef GRANTLEE_NODE_H 22 #define GRANTLEE_NODE_H 27 #include "filterexpression.h" 28 #include "grantlee_core_export.h" 29 #include "outputstream.h" 30 #include "safestring.h" 32 #include <QtCore/QStringList> 36 #include <QtCore/QSet> 37 #include <QtCore/QVector> 76 class GRANTLEE_CORE_EXPORT
Node :
public QObject
85 explicit Node( QObject *parent = 0 );
104 virtual bool mustBeFirst() {
121 TemplateImpl* containerTemplate()
const;
124 Q_DECLARE_PRIVATE(
Node )
125 NodePrivate *
const d_ptr;
142 class GRANTLEE_CORE_EXPORT
NodeList :
public QList<Grantlee::Node*>
158 NodeList(
const QList<Grantlee::Node *> &list );
173 void append( QList<Grantlee::Node*> nodeList );
178 bool containsNonText()
const;
183 template <
typename T>
186 QList<Grantlee::Node*>::const_iterator it;
187 const QList<Grantlee::Node*>::const_iterator first = constBegin();
188 const QList<Grantlee::Node*>::const_iterator last = constEnd();
189 for ( it = first; it != last; ++it ) {
190 T
object = qobject_cast<T>( *it );
194 children << ( *it )->findChildren<T>();
205 bool m_containsNonText;
208 class AbstractNodeFactoryPrivate;
308 virtual Node* getNode(
const QString &tagContent,
Parser *p )
const = 0;
316 virtual void setEngine(
Engine * ) {}
333 Q_INVOKABLE QStringList smartSplit(
const QString &str )
const;
341 QList<FilterExpression> getFilterExpressionList(
const QStringList &list,
Parser *p )
const;
345 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.