Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsAutoIndexBuffer Struct Reference

List of all members.

Public Member Functions

 nsAutoIndexBuffer ()
 ~nsAutoIndexBuffer ()
nsresult GrowTo (PRInt32 aAtLeast)

Public Attributes

PRInt32mBuffer
PRInt32 mBufferLen
PRInt32 mAutoBuffer [TEXT_BUF_SIZE]

Detailed Description

Definition at line 152 of file nsTextFrame.cpp.


Constructor & Destructor Documentation

Definition at line 163 of file nsTextFrame.cpp.

  : mBuffer(mAutoBuffer),
    mBufferLen(TEXT_BUF_SIZE)
{
#ifdef DEBUG
  memset(mAutoBuffer, 0xdd, sizeof(mAutoBuffer));
#endif 
}

Here is the call graph for this function:

Definition at line 172 of file nsTextFrame.cpp.

{
  if (mBuffer && (mBuffer != mAutoBuffer)) {
    delete [] mBuffer;
  }
}

Member Function Documentation

Definition at line 180 of file nsTextFrame.cpp.

{
  if (aAtLeast > mBufferLen)
  {
    PRInt32 newSize = mBufferLen * 2;
    if (newSize < mBufferLen + aAtLeast) {
      newSize = mBufferLen * 2 + aAtLeast;
    }
    PRInt32* newBuffer = new PRInt32[newSize];
    if (!newBuffer) {
      return NS_ERROR_OUT_OF_MEMORY;
    }
#ifdef DEBUG
    memset(newBuffer, 0xdd, sizeof(PRInt32) * newSize);
#endif
    memcpy(newBuffer, mBuffer, sizeof(PRInt32) * mBufferLen);
    if (mBuffer != mAutoBuffer) {
      delete [] mBuffer;
    }
    mBuffer = newBuffer;
    mBufferLen = newSize;
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 160 of file nsTextFrame.cpp.

Definition at line 158 of file nsTextFrame.cpp.

Definition at line 159 of file nsTextFrame.cpp.


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