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() {
124 Q_DECLARE_PRIVATE(
Node )
125 NodePrivate *
const d_ptr;
142 class GRANTLEE_CORE_EXPORT
NodeList :
public QList<Grantlee::Node*>
173 void append( QList<Grantlee::Node*> nodeList );
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;
316 virtual void setEngine(
Engine * ) {}
333 Q_INVOKABLE QStringList
smartSplit(
const QString &str )
const;
345 AbstractNodeFactoryPrivate *
const d_ptr;
The Parser class processes a string template into a tree of nodes.
The Context class holds the context to render a template with.
Base class for all nodes.
AbstractNodeFactory(QObject *parent=0)
Grantlee::Engine is the main entry point for creating Grantlee Templates.
NodeList(const QList< Grantlee::Node * > &list)
QList< T > findChildren()
void streamValueInContext(OutputStream *stream, const QVariant &input, Grantlee::Context *c)
virtual ~AbstractNodeFactory()
void append(Grantlee::Node *node)
Base class for all NodeFactories.
bool containsNonText() const
TemplateImpl * containerTemplate() const
virtual Node * getNode(const QString &tagContent, Parser *p) const =0
virtual void render(OutputStream *stream, Context *c)=0
NodeList(const NodeList &list)
QList< FilterExpression > getFilterExpressionList(const QStringList &list, Parser *p) const
A list of Nodes with some convenience API for rendering them.
Q_INVOKABLE QStringList smartSplit(const QString &str) const
The Grantlee namespace holds all public Grantlee API.
void render(OutputStream *stream, Context *c)
The OutputStream class is used to render templates to a QTextStream.
void append(QList< Grantlee::Node * > nodeList)