Cutelee 6.1.0
Cutelee::NodeList Class Reference

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

#include <cutelee/node.h>

Inheritance diagram for Cutelee::NodeList:

Public Member Functions

 NodeList ()
 NodeList (const NodeList &list)
 NodeList (const QList< Cutelee::Node * > &list)
 ~NodeList ()
void append (const QList< Cutelee::Node * > &nodeList)
void append (Cutelee::Node *node)
bool containsNonText () const
template<typename T>
QList< T > findChildren ()
NodeListoperator= (const NodeList &list)
void render (OutputStream *stream, Context *c) const
Public Member Functions inherited from QList< Cutelee::Node * >
void append (const T &value)
const T & at (int i) const const
T & back ()
iterator begin ()
const_iterator cbegin () const const
const_iterator cend () const const
void clear ()
const_iterator constBegin () const const
const_iterator constEnd () const const
const T & constFirst () const const
const T & constLast () const const
bool contains (const T &value) const const
int count (const T &value) const const
const_reverse_iterator crbegin () const const
const_reverse_iterator crend () const const
bool empty () const const
iterator end ()
bool endsWith (const T &value) const const
iterator erase (iterator pos)
T & first ()
T & front ()
int indexOf (const T &value, int from) const const
void insert (int i, const T &value)
bool isEmpty () const const
T & last ()
int lastIndexOf (const T &value, int from) const const
int length () const const
QList< T > mid (int pos, int length) const const
void move (int from, int to)
bool operator!= (const QList< T > &other) const const
QList< T > operator+ (const QList< T > &other) const const
QList< T > & operator+= (const QList< T > &other)
bool operator< (const QList< T > &lhs, const QList< T > &rhs)
QList< T > & operator<< (const T &value)
bool operator<= (const QList< T > &lhs, const QList< T > &rhs)
QList< T > & operator= (const QList< T > &other)
bool operator== (const QList< T > &other) const const
bool operator> (const QList< T > &lhs, const QList< T > &rhs)
bool operator>= (const QList< T > &lhs, const QList< T > &rhs)
QDataStreamoperator>> (QDataStream &in, QList< T > &list)
const T & operator[] (int i) const const
void pop_back ()
void pop_front ()
void prepend (const T &value)
void push_back (const T &value)
void push_front (const T &value)
uint qHash (const QList< T > &key, uint seed)
reverse_iterator rbegin ()
int removeAll (const T &value)
void removeAt (int i)
void removeFirst ()
void removeLast ()
bool removeOne (const T &value)
reverse_iterator rend ()
void replace (int i, const T &value)
void reserve (int alloc)
int size () const const
bool startsWith (const T &value) const const
void swap (QList< T > &other)
void swapItemsAt (int i, int j)
takeAt (int i)
takeFirst ()
takeLast ()
QSet< T > toSet () const const
std::list< T > toStdList () const const
QVector< T > toVector () const const
value (int i) const const

Additional Inherited Members

Static Public Member Functions inherited from QList< Cutelee::Node * >
QList< T > fromSet (const QSet< T > &set)
QList< T > fromStdList (const std::list< T > &list)
QList< T > fromVector (const QVector< T > &vector)
Public Attributes inherited from QList< Cutelee::Node * >
typedef const_pointer
typedef const_reference
typedef const_reverse_iterator
typedef ConstIterator
typedef difference_type
typedef Iterator
typedef pointer
typedef reference
typedef reverse_iterator
typedef size_type
typedef value_type

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 147 of file node.h.

Constructor & Destructor Documentation

◆ NodeList() [1/3]

NodeList::NodeList ( )

Creates an empty NodeList.

Definition at line 119 of file node.cpp.

References QList< Cutelee::Node * >::QList().

Referenced by NodeList().

◆ NodeList() [2/3]

NodeList::NodeList ( const NodeList & list)

Copy constructor.

Definition at line 121 of file node.cpp.

References NodeList(), and QList< Cutelee::Node * >::QList().

◆ NodeList() [3/3]

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

Convenience constructor

Definition at line 134 of file node.cpp.

References QList< Cutelee::Node * >::QList().

◆ ~NodeList()

NodeList::~NodeList ( )

Destructor.

Definition at line 147 of file node.cpp.

Member Function Documentation

◆ append() [1/2]

void NodeList::append ( const QList< Cutelee::Node * > & nodeList)

Appends nodeList to the end of this NodeList.

Definition at line 160 of file node.cpp.

References QList< Cutelee::Node * >::QList(), and QList::append().

◆ append() [2/2]

void NodeList::append ( Cutelee::Node * node)

Appends node to the end of this NodeList.

Definition at line 149 of file node.cpp.

References QList::append().

◆ containsNonText()

bool NodeList::containsNonText ( ) const

Returns true if this NodeList contains non-text nodes.

Definition at line 175 of file node.cpp.

◆ findChildren()

template<typename T>
QList< T > Cutelee::NodeList::findChildren ( )
inline

◆ operator=()

NodeList & NodeList::operator= ( const NodeList & list)

Definition at line 126 of file node.cpp.

◆ render()

void NodeList::render ( OutputStream * stream,
Context * c ) const

Renders the list of Nodes in the Context c.

Definition at line 177 of file node.cpp.

References QList< Cutelee::Node * >::at(), and QList< Cutelee::Node * >::size().