Logo Search packages:      
Sourcecode: rarian version File versions

const TiXmlNode * TiXmlNode::IterateChildren ( const TiXmlNode previous  )  const [inherited]

An alternate way to walk the children of a node. One way to iterate over nodes is:

			for( child = parent->FirstChild(); child; child = child->NextSibling() )

IterateChildren does the same thing with the syntax:

			child = 0;
			while( child = parent->IterateChildren( child ) )

IterateChildren takes the previous child as input and finds the next one. If the previous child is null, it returns the first. IterateChildren will return null when done.

Definition at line 372 of file tinyxml.cpp.

References TiXmlNode::FirstChild(), TiXmlNode::NextSibling(), and TiXmlNode::parent.

      if ( !previous )
            return FirstChild();
            assert( previous->parent == this );
            return previous->NextSibling();

Generated by  Doxygen 1.6.0   Back to index