Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes
nsScannerBufferList::Position Class Reference

Position objects serve as lightweight pointers into a buffer list. More...

#include <nsScannerString.h>

Collaboration diagram for nsScannerBufferList::Position:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Position ()
 Position (Buffer *buffer, PRUnichar *position)
 Position (const nsScannerIterator &aIter)
Positionoperator= (const nsScannerIterator &aIter)

Static Public Member Functions

static size_t Distance (const Position &p1, const Position &p2)

Public Attributes

BuffermBuffer
PRUnicharmPosition

Detailed Description

Position objects serve as lightweight pointers into a buffer list.

The mPosition member must be contained with mBuffer->DataStart() and mBuffer->DataEnd().

Definition at line 132 of file nsScannerString.h.


Constructor & Destructor Documentation

Definition at line 136 of file nsScannerString.h.

{}
nsScannerBufferList::Position::Position ( Buffer buffer,
PRUnichar position 
) [inline]

Definition at line 138 of file nsScannerString.h.

Definition at line 549 of file nsScannerString.h.

  : mBuffer(NS_CONST_CAST(Buffer*, aIter.buffer()))
  , mPosition(NS_CONST_CAST(PRUnichar*, aIter.get()))
  {}

Member Function Documentation

Definition at line 142 of file nsScannerString.cpp.

  {
    size_t result = 0;
    if (aStart.mBuffer == aEnd.mBuffer)
      {
        result = aEnd.mPosition - aStart.mPosition;
      }
    else
      {
        result = aStart.mBuffer->DataEnd() - aStart.mPosition;
        for (Buffer* b = aStart.mBuffer->Next(); b != aEnd.mBuffer; b = b->Next())
          result += b->DataLength();
        result += aEnd.mPosition - aEnd.mBuffer->DataStart();
      }
    return result;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

nsScannerBufferList::Position & nsScannerBufferList::Position::operator= ( const nsScannerIterator aIter) [inline]

Definition at line 556 of file nsScannerString.h.

  {
    mBuffer   = NS_CONST_CAST(Buffer*, aIter.buffer());
    mPosition = NS_CONST_CAST(PRUnichar*, aIter.get());
    return *this;
  }

Here is the call graph for this function:


Member Data Documentation

Definition at line 151 of file nsScannerString.h.

Definition at line 152 of file nsScannerString.h.


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