Grantlee  0.4.0
Public Member Functions
Grantlee::NodeList Class Reference

A list of Nodes with some convenience API for rendering them. More...

#include <grantlee/node.h>

List of all members.

Public Member Functions

 NodeList ()
 NodeList (const NodeList &list)
 NodeList (const QList< Grantlee::Node * > &list)
 ~NodeList ()
void append (Grantlee::Node *node)
void append (QList< Grantlee::Node * > nodeList)
bool containsNonText () const
template<typename T >
QList< T > findChildren ()
void render (OutputStream *stream, Context *c)

Detailed Description

Typically, tags which have an end tag will create and later render a list of child nodes.

This class contains API such as append and render to make creating such list easily.

The findChildren method behaves similarly to the QObject::findChildren method, returning a list of nodes of a particular type from the Node objects contained in the list (and their children).

See also:
Tags with end tags

Definition at line 142 of file node.h.


Constructor & Destructor Documentation

Creates an empty NodeList.

Copy constructor.

Grantlee::NodeList::NodeList ( const QList< Grantlee::Node * > &  list)

Convenience constructor

Destructor.


Member Function Documentation

Appends node to the end of this NodeList.

void Grantlee::NodeList::append ( QList< Grantlee::Node * >  nodeList)

Appends nodeList to the end of this NodeList.

Returns true if this NodeList contains non-text nodes.

template<typename T >
QList<T> Grantlee::NodeList::findChildren ( ) [inline]

A recursive listing of nodes in this tree of type T.

Definition at line 184 of file node.h.

void Grantlee::NodeList::render ( OutputStream stream,
Context c 
)

Renders the list of Nodes in the Context c.