Back to index

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

#include <morkBlob.h>

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

List of all members.

Public Member Functions

 morkCoil (morkEnv *ev, nsIMdbHeap *ioHeap)
void CloseCoil (morkEnv *ev)
mork_bool GrowCoil (morkEnv *ev, mork_size inNewSize)
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

nsIMdbHeapmCoil_Heap
mork_cscode mText_Form
mork_size mBlob_Size
voidmBuf_Body
mork_fill mBuf_Fill

Private Member Functions

 morkCoil (const morkCoil &other)
morkCoiloperator= (const morkCoil &other)

Detailed Description

Definition at line 149 of file morkBlob.h.


Constructor & Destructor Documentation

morkCoil::morkCoil ( morkEnv ev,
nsIMdbHeap ioHeap 
)

Definition at line 116 of file morkBlob.cpp.

{
  mBuf_Body = 0;
  mBuf_Fill = 0;
  mBlob_Size = 0;
  mText_Form = 0;
  mCoil_Heap = ioHeap;
  if ( !ioHeap )
    ev->NilPointerError();
}

Here is the call graph for this function:

morkCoil::morkCoil ( const morkCoil other) [private]

Member Function Documentation

void morkBlob::BlobFillOverSizeError ( morkEnv ev) [static, inherited]

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:

Definition at line 128 of file morkBlob.cpp.

{
  void* body = mBuf_Body;
  nsIMdbHeap* heap = mCoil_Heap;

  mBuf_Body = 0;
  mCoil_Heap = 0;
  
  if ( body && heap )
  {
    heap->Free(ev->AsMdbEnv(), body);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

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:

mork_bool morkCoil::GrowCoil ( morkEnv ev,
mork_size  inNewSize 
) [inline]

Definition at line 163 of file morkBlob.h.

  { return this->GrowBlob(ev, mCoil_Heap, inNewSize); }

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:

morkCoil& morkCoil::operator= ( const morkCoil 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.

Definition at line 156 of file morkBlob.h.

Definition at line 114 of file morkBlob.h.


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