Back to index

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

List of all members.

Public Member Functions

 nsAutoPRUint8Buffer ()
 ~nsAutoPRUint8Buffer ()
nsresult GrowTo (PRInt32 aAtLeast)

Public Attributes

PRUint8mBuffer
PRInt32 mBufferLen
PRUint8 mAutoBuffer [TEXT_BUF_SIZE]

Detailed Description

Definition at line 205 of file nsTextFrame.cpp.


Constructor & Destructor Documentation

Definition at line 216 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 225 of file nsTextFrame.cpp.

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

Member Function Documentation

Definition at line 233 of file nsTextFrame.cpp.

{
  if (aAtLeast > mBufferLen)
  {
    PRInt32 newSize = mBufferLen * 2;
    if (newSize < mBufferLen + aAtLeast) {
      newSize = mBufferLen * 2 + aAtLeast;
    }
    PRUint8* newBuffer = new PRUint8[newSize];
    if (!newBuffer) {
      return NS_ERROR_OUT_OF_MEMORY;
    }
#ifdef DEBUG
    memset(newBuffer, 0xdd, sizeof(PRUint8) * newSize);
#endif
    memcpy(newBuffer, mBuffer, sizeof(PRUint8) * 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 213 of file nsTextFrame.cpp.

Definition at line 211 of file nsTextFrame.cpp.

Definition at line 212 of file nsTextFrame.cpp.


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