Back to index

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

#include <morkBlob.h>

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

List of all members.

Public Member Functions

 morkBlob ()
 morkBlob (const void *ioBuf, mork_fill inFill, mork_size inSize)
mork_bool GrowBlob (morkEnv *ev, nsIMdbHeap *ioHeap, mork_size inNewSize)
void ClearBufFill ()

Static Public Member Functions

static void BlobFillOverSizeError (morkEnv *ev)
static void NilBufBodyError (morkEnv *ev)

Public Attributes

mork_size mBlob_Size
voidmBuf_Body
mork_fill mBuf_Fill

Private Member Functions

 morkBlob (const morkBlob &other)
morkBloboperator= (const morkBlob &other)

Detailed Description

Definition at line 76 of file morkBlob.h.


Constructor & Destructor Documentation

morkBlob::morkBlob ( ) [inline]

Definition at line 84 of file morkBlob.h.

{ }
morkBlob::morkBlob ( const void ioBuf,
mork_fill  inFill,
mork_size  inSize 
) [inline]

Definition at line 85 of file morkBlob.h.

  : morkBuf(ioBuf, inFill), mBlob_Size(inSize) { }
morkBlob::morkBlob ( const morkBlob other) [private]

Member Function Documentation

Definition at line 66 of file morkBlob.cpp.

{
  ev->NewError("mBuf_Fill > mBlob_Size");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkBuf::ClearBufFill ( ) [inline, inherited]

Definition at line 61 of file morkBlob.h.

{ mBuf_Fill = 0; }

Here is the caller graph for this function:

mork_bool morkBlob::GrowBlob ( morkEnv ev,
nsIMdbHeap ioHeap,
mork_size  inNewSize 
)

Definition at line 74 of file morkBlob.cpp.

{
  if ( ioHeap )
  {
    if ( !mBuf_Body ) // no body? implies zero sized?
      mBlob_Size = 0;
      
    if ( mBuf_Fill > mBlob_Size ) // fill more than size?
    {
      ev->NewWarning("mBuf_Fill > mBlob_Size");
      mBuf_Fill = mBlob_Size;
    }
      
    if ( inNewSize > mBlob_Size ) // need to allocate larger blob?
    {
      mork_u1* body = 0;
      ioHeap->Alloc(ev->AsMdbEnv(), inNewSize, (void**) &body);
      if ( body && ev->Good() )
      {
        void* oldBody = mBuf_Body;
        if ( mBlob_Size ) // any old content to transfer?
          MORK_MEMCPY(body, oldBody, mBlob_Size);
        
        mBlob_Size = inNewSize; // install new size
        mBuf_Body = body; // install new body
        
        if ( oldBody ) // need to free old buffer body?
          ioHeap->Free(ev->AsMdbEnv(), oldBody);
      }
    }
  }
  else
    ev->NilPointerError();
    
  if ( ev->Good() && mBlob_Size < inNewSize )
    ev->NewError("mBlob_Size < inNewSize");
    
  return ev->Good();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morkBuf::NilBufBodyError ( morkEnv ev) [static, inherited]

Definition at line 58 of file morkBlob.cpp.

{
  ev->NewError("nil mBuf_Body");
}

Here is the call graph for this function:

Here is the caller graph for this function:

morkBlob& morkBlob::operator= ( const morkBlob other) [private]

Member Data Documentation

Definition at line 81 of file morkBlob.h.

void* morkBuf::mBuf_Body [inherited]

Definition at line 53 of file morkBlob.h.

Definition at line 54 of file morkBlob.h.


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