Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions
UnicharBufferImpl Class Reference

#include <nsUnicharBuffer.h>

Inheritance diagram for UnicharBufferImpl:
Inheritance graph
[legend]
Collaboration diagram for UnicharBufferImpl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 UnicharBufferImpl ()
NS_DECL_ISUPPORTS NS_IMETHOD Init (PRUint32 aBufferSize)
 NS_IMETHOD_ (PRInt32) GetLength() const
 NS_IMETHOD_ (PRInt32) GetBufferSize() const
 NS_IMETHOD_ (PRUnichar *) GetBuffer() const
 NS_IMETHOD_ (PRBool) Grow(PRInt32 aNewSize)
 NS_DEFINE_STATIC_IID_ACCESSOR (NS_IUNICHARBUFFER_IID)

Static Public Member Functions

static NS_METHOD Create (nsISupports *aOuter, REFNSIID aIID, void **aResult)

Public Attributes

PRUnicharmBuffer
PRUint32 mSpace
PRUint32 mLength

Private Member Functions

 ~UnicharBufferImpl ()

Detailed Description

Definition at line 43 of file nsUnicharBuffer.h.


Constructor & Destructor Documentation

Definition at line 44 of file nsUnicharBuffer.cpp.

  : mBuffer(NULL), mSpace(0), mLength(0)
{
}

Here is the caller graph for this function:

Definition at line 79 of file nsUnicharBuffer.cpp.

{
  if (nsnull != mBuffer) {
    delete[] mBuffer;
    mBuffer = nsnull;
  }
  mLength = 0;
}

Member Function Documentation

NS_METHOD UnicharBufferImpl::Create ( nsISupports *  aOuter,
REFNSIID  aIID,
void **  aResult 
) [static]

Definition at line 50 of file nsUnicharBuffer.cpp.

{
  if (aOuter)
    return NS_ERROR_NO_AGGREGATION;

  UnicharBufferImpl* it = new UnicharBufferImpl();
  if (it == nsnull) 
    return NS_ERROR_OUT_OF_MEMORY;

  NS_ADDREF(it);
  nsresult rv = it->QueryInterface(aIID, aResult);
  NS_RELEASE(it);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP UnicharBufferImpl::Init ( PRUint32  aBufferSize) [virtual]

Implements nsIUnicharBuffer.

Definition at line 66 of file nsUnicharBuffer.cpp.

{
  if (aBufferSize < MIN_BUFFER_SIZE) {
    aBufferSize = MIN_BUFFER_SIZE;
  }
  mSpace = aBufferSize;
  mLength = 0;
  mBuffer = new PRUnichar[aBufferSize];
  return mBuffer ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
UnicharBufferImpl::NS_IMETHOD_ ( PRInt32  ) const [virtual]

Implements nsIUnicharBuffer.

UnicharBufferImpl::NS_IMETHOD_ ( PRInt32  ) const [virtual]

Implements nsIUnicharBuffer.

UnicharBufferImpl::NS_IMETHOD_ ( PRUnichar ) const [virtual]

Implements nsIUnicharBuffer.

Implements nsIUnicharBuffer.


Member Data Documentation

Definition at line 57 of file nsUnicharBuffer.h.

Definition at line 59 of file nsUnicharBuffer.h.

Definition at line 58 of file nsUnicharBuffer.h.


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