Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
nsXFormsControlListItem::iterator Class Reference

An iterator implementation for the class. More...

#include <nsXFormsModelElement.h>

Collaboration diagram for nsXFormsControlListItem::iterator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 iterator ()
 iterator (const iterator &)
iterator operator= (nsXFormsControlListItem *)
bool operator!= (const nsXFormsControlListItem *)
iterator operator++ ()
nsXFormsControlListItemoperator* ()

Private Attributes

nsRefPtr< nsXFormsControlListItemmCur
 The control the iterator is currently pointing at.
nsVoidArray mStack
 A stack of non-visited nodes.

Detailed Description

An iterator implementation for the class.

Definition at line 225 of file nsXFormsModelElement.h.


Constructor & Destructor Documentation

Definition at line 194 of file nsXFormsModelElement.cpp.

  : mCur(0)
{
}

Definition at line 199 of file nsXFormsModelElement.cpp.

  : mCur(aCopy.mCur)
{
  mStack = aCopy.mStack;
}

Member Function Documentation

bool nsXFormsControlListItem::iterator::operator!= ( const nsXFormsControlListItem aCnt)

Definition at line 213 of file nsXFormsModelElement.cpp.

{
  return mCur != aCnt;
}
nsXFormsControlListItem * nsXFormsControlListItem::iterator::operator* ( )

Definition at line 245 of file nsXFormsModelElement.cpp.

{
  return mCur;
}
nsXFormsControlListItem::iterator nsXFormsControlListItem::iterator::operator++ ( )

Definition at line 219 of file nsXFormsModelElement.cpp.

{
  if (!mCur)
    return *this;

  if (mCur->mFirstChild) {
    if (!mCur->mNextSibling) {
      mCur = mCur->mFirstChild;
      return *this;
    }
    mStack.AppendElement(mCur->mFirstChild);
  }

  if (mCur->mNextSibling) {
    mCur = mCur->mNextSibling;
  } else if (mStack.Count()) {
    mCur = (nsXFormsControlListItem*) mStack[mStack.Count() - 1];
    mStack.RemoveElementAt(mStack.Count() - 1);
  } else {
    mCur = nsnull;
  }

  return *this;
}
nsXFormsControlListItem::iterator nsXFormsControlListItem::iterator::operator= ( nsXFormsControlListItem aCnt)

Definition at line 206 of file nsXFormsModelElement.cpp.

{
  mCur = aCnt;
  return *this;
}

Member Data Documentation

The control the iterator is currently pointing at.

Definition at line 229 of file nsXFormsModelElement.h.

A stack of non-visited nodes.

Definition at line 232 of file nsXFormsModelElement.h.


The documentation for this class was generated from the following files: