Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Private Attributes | Friends
nsReadingIterator< CharT > Class Template Reference

#include <nsStringIterator.h>

List of all members.

Public Types

typedef nsReadingIterator< CharTself_type
typedef ptrdiff_t difference_type
typedef CharT value_type
typedef const CharTpointer
typedef const CharTreference

Public Member Functions

 nsReadingIterator ()
void normalize_forward ()
void normalize_backward ()
pointer start () const
pointer end () const
pointer get () const
CharT operator* () 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)

Private Attributes

const CharTmStart
const CharTmEnd
const CharTmPosition

Friends

class nsAString
class nsACString

Detailed Description

template<class CharT>
class nsReadingIterator< CharT >

See also:
nsTAString

Definition at line 59 of file nsStringIterator.h.


Member Typedef Documentation

template<class CharT>
typedef ptrdiff_t nsReadingIterator< CharT >::difference_type

Definition at line 63 of file nsStringIterator.h.

template<class CharT>
typedef const CharT* nsReadingIterator< CharT >::pointer

Definition at line 65 of file nsStringIterator.h.

template<class CharT>
typedef const CharT& nsReadingIterator< CharT >::reference

Definition at line 66 of file nsStringIterator.h.

template<class CharT>
typedef nsReadingIterator<CharT> nsReadingIterator< CharT >::self_type

Definition at line 62 of file nsStringIterator.h.

template<class CharT>
typedef CharT nsReadingIterator< CharT >::value_type

Definition at line 64 of file nsStringIterator.h.


Constructor & Destructor Documentation

template<class CharT>
nsReadingIterator< CharT >::nsReadingIterator ( ) [inline]

Definition at line 86 of file nsStringIterator.h.

{ }

Member Function Documentation

template<class CharT>
self_type& nsReadingIterator< CharT >::advance ( difference_type  n) [inline]

Definition at line 170 of file nsStringIterator.h.

        {
          if (n > 0)
            {
              difference_type step = NS_MIN(n, size_forward());

              NS_ASSERTION(step>0, "can't advance a reading iterator beyond the end of a string");

              mPosition += step;
            }
          else if (n < 0)
            {
              difference_type step = NS_MAX(n, -size_backward());

              NS_ASSERTION(step<0, "can't advance (backward) a reading iterator beyond the end of a string");

              mPosition += step;
            }
          return *this;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

template<class CharT>
pointer nsReadingIterator< CharT >::end ( ) const [inline]

Definition at line 100 of file nsStringIterator.h.

        {
          return mEnd;
        }
template<class CharT>
pointer nsReadingIterator< CharT >::get ( ) const [inline]

Definition at line 106 of file nsStringIterator.h.

        {
          return mPosition;
        }

Here is the caller graph for this function:

template<class CharT>
void nsReadingIterator< CharT >::normalize_backward ( ) [inline]

Definition at line 91 of file nsStringIterator.h.

{}
template<class CharT>
void nsReadingIterator< CharT >::normalize_forward ( ) [inline]

Definition at line 90 of file nsStringIterator.h.

{}
template<class CharT>
CharT nsReadingIterator< CharT >::operator* ( ) const [inline]

Definition at line 112 of file nsStringIterator.h.

        {
          return *get();
        }
template<class CharT>
self_type& nsReadingIterator< CharT >::operator++ ( ) [inline]

Definition at line 128 of file nsStringIterator.h.

        {
          ++mPosition;
          return *this;
        }
template<class CharT>
self_type nsReadingIterator< CharT >::operator++ ( int  ) [inline]

Definition at line 135 of file nsStringIterator.h.

        {
          self_type result(*this);
          ++mPosition;
          return result;
        }
template<class CharT>
self_type& nsReadingIterator< CharT >::operator-- ( ) [inline]

Definition at line 143 of file nsStringIterator.h.

        {
          --mPosition;
          return *this;
        }
template<class CharT>
self_type nsReadingIterator< CharT >::operator-- ( int  ) [inline]

Definition at line 150 of file nsStringIterator.h.

        {
          self_type result(*this);
          --mPosition;
          return result;
        }
template<class CharT>
difference_type nsReadingIterator< CharT >::size_backward ( ) const [inline]

Definition at line 164 of file nsStringIterator.h.

        {
          return mPosition - mStart;
        }

Here is the caller graph for this function:

template<class CharT>
difference_type nsReadingIterator< CharT >::size_forward ( ) const [inline]

Definition at line 158 of file nsStringIterator.h.

        {
          return mEnd - mPosition;
        }

Here is the caller graph for this function:

template<class CharT>
pointer nsReadingIterator< CharT >::start ( ) const [inline]

Definition at line 94 of file nsStringIterator.h.

        {
          return mStart;
        }

Friends And Related Function Documentation

template<class CharT>
friend class nsACString [friend]

Definition at line 70 of file nsStringIterator.h.

template<class CharT>
friend class nsAString [friend]

Definition at line 69 of file nsStringIterator.h.


Member Data Documentation

template<class CharT>
const CharT* nsReadingIterator< CharT >::mEnd [private]

Definition at line 82 of file nsStringIterator.h.

template<class CharT>
const CharT* nsReadingIterator< CharT >::mPosition [private]

Definition at line 83 of file nsStringIterator.h.

template<class CharT>
const CharT* nsReadingIterator< CharT >::mStart [private]

Definition at line 81 of file nsStringIterator.h.


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