Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Protected Attributes | Friends
nsScannerIterator Class Reference

nsScannerIterator works just like nsReadingIterator<CharT> except that it knows how to iterate over a list of scanner buffers. More...

#include <nsScannerString.h>

Collaboration diagram for nsScannerIterator:
Collaboration graph
[legend]

List of all members.

Public Types

typedef nsScannerIterator self_type
typedef ptrdiff_t difference_type
typedef PRUnichar value_type
typedef const PRUnicharpointer
typedef const PRUnicharreference
typedef nsScannerSubstring::Buffer Buffer

Public Member Functions

 nsScannerIterator ()
void normalize_forward ()
 inline methods follow
void normalize_backward ()
pointer get () const
PRUnichar operator* () const
const nsScannerFragmentfragment () const
const Bufferbuffer () const
self_typeoperator++ ()
self_type operator++ (int)
self_typeoperator-- ()
self_type operator-- (int)
difference_type size_forward () const
difference_type size_backward () const
self_typeadvance (difference_type n)

Protected Attributes

nsScannerFragment mFragment
const PRUnicharmPosition
const nsScannerSubstringmOwner

Friends

class nsScannerSubstring
class nsScannerSharedSubstring

Detailed Description

nsScannerIterator works just like nsReadingIterator<CharT> except that it knows how to iterate over a list of scanner buffers.

Definition at line 356 of file nsScannerString.h.


Member Typedef Documentation

Definition at line 364 of file nsScannerString.h.

Definition at line 360 of file nsScannerString.h.

Definition at line 362 of file nsScannerString.h.

Definition at line 363 of file nsScannerString.h.

Definition at line 359 of file nsScannerString.h.

Definition at line 361 of file nsScannerString.h.


Constructor & Destructor Documentation

Definition at line 376 of file nsScannerString.h.

{}

Member Function Documentation

Definition at line 443 of file nsScannerString.h.

        {
          while ( n > 0 )
            {
              difference_type one_hop = NS_MIN(n, size_forward());

              NS_ASSERTION(one_hop>0, "Infinite loop: can't advance a reading iterator beyond the end of a string");
                // perhaps I should |break| if |!one_hop|?

              mPosition += one_hop;
              normalize_forward();
              n -= one_hop;
            }

          while ( n < 0 )
            {
              normalize_backward();
              difference_type one_hop = NS_MAX(n, -size_backward());

              NS_ASSERTION(one_hop<0, "Infinite loop: can't advance (backward) a reading iterator beyond the end of a string");
                // perhaps I should |break| if |!one_hop|?

              mPosition += one_hop;
              n -= one_hop;
            }

          return *this;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

const Buffer* nsScannerIterator::buffer ( ) const [inline]

Definition at line 398 of file nsScannerString.h.

        {
          return mFragment.mBuffer;
        }

Here is the caller graph for this function:

Definition at line 393 of file nsScannerString.h.

        {
          return mFragment;
        }

Here is the caller graph for this function:

pointer nsScannerIterator::get ( ) const [inline]

Definition at line 383 of file nsScannerString.h.

        {
          return mPosition;
        }

Here is the caller graph for this function:

inline methods follow

Definition at line 519 of file nsScannerString.h.

Here is the caller graph for this function:

PRUnichar nsScannerIterator::operator* ( ) const [inline]

Definition at line 388 of file nsScannerString.h.

        {
          return *get();
        }
self_type& nsScannerIterator::operator++ ( ) [inline]

Definition at line 403 of file nsScannerString.h.

        {
          ++mPosition;
          normalize_forward();
          return *this;
        }
self_type nsScannerIterator::operator++ ( int  ) [inline]

Definition at line 410 of file nsScannerString.h.

        {
          self_type result(*this);
          ++mPosition;
          normalize_forward();
          return result;
        }
self_type& nsScannerIterator::operator-- ( ) [inline]

Definition at line 418 of file nsScannerString.h.

        {
          normalize_backward();
          --mPosition;
          return *this;
        }
self_type nsScannerIterator::operator-- ( int  ) [inline]

Definition at line 425 of file nsScannerString.h.

        {
          self_type result(*this);
          normalize_backward();
          --mPosition;
          return result;
        }

Definition at line 438 of file nsScannerString.h.

Definition at line 433 of file nsScannerString.h.

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class nsScannerSharedSubstring [friend]

Definition at line 373 of file nsScannerString.h.

friend class nsScannerSubstring [friend]

Definition at line 372 of file nsScannerString.h.


Member Data Documentation

Definition at line 368 of file nsScannerString.h.

Definition at line 370 of file nsScannerString.h.

Definition at line 369 of file nsScannerString.h.


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