Back to index

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

#include <mozSqlResult.h>

List of all members.

Public Member Functions

 Cell (PRInt32 aType)
 ~Cell ()
void SetString (PRUnichar *aString)
PRInt32 GetType ()
void SetNull (PRBool aNull)
void SetDefault (PRBool aDefault)
PRBool IsNull ()
PRBool IsDefault ()

Static Public Member Functions

static CellCreate (nsFixedSizeAllocator &aAllocator, PRInt32 aType)
static CellCreate (nsFixedSizeAllocator &aAllocator, PRInt32 aType, Cell *aSrcCell)
static void Copy (Cell *aSrcCell, Cell *aDestCell)
static void Destroy (nsFixedSizeAllocator &aAllocator, Cell *aCell)

Public Attributes

union Cell.__unnamed__ 

Static Private Member Functions

static voidoperator new (size_t) CPP_THROW_NEW
static void operator delete (void *, size_t)

Private Attributes

PRInt8 mType

Detailed Description

Definition at line 116 of file mozSqlResult.h.


Constructor & Destructor Documentation

Cell::Cell ( PRInt32  aType) [inline]

Definition at line 166 of file mozSqlResult.h.

      : mString(nsnull),
        mType(aType | CELL_FLAG_NULL) {
    }

Here is the caller graph for this function:

Cell::~Cell ( ) [inline]

Definition at line 171 of file mozSqlResult.h.

            {
      if ((GetType() == mozISqlResult::TYPE_STRING) && mString) {
        nsMemory::Free(mString);
      }
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

static void Cell::Copy ( Cell aSrcCell,
Cell aDestCell 
) [inline, static]

Definition at line 138 of file mozSqlResult.h.

                                          {
      if (aSrcCell->IsNull())
        aDestCell->SetNull(PR_TRUE);
      else {
        aDestCell->SetNull(PR_FALSE);
        PRInt32 type = aSrcCell->GetType();
        if (type == mozISqlResult::TYPE_STRING)
          aDestCell->SetString(nsCRT::strdup(aSrcCell->mString));
        else if (type == mozISqlResult::TYPE_INT)
          aDestCell->mInt = aSrcCell->mInt;
        else if (type == mozISqlResult::TYPE_FLOAT ||
                 type == mozISqlResult::TYPE_DECIMAL)
          aDestCell->mFloat = aSrcCell->mFloat;
        else if (type == mozISqlResult::TYPE_DATE ||
                 type == mozISqlResult::TYPE_TIME ||
                 type == mozISqlResult::TYPE_DATETIME)
          aDestCell->mDate = aSrcCell->mDate;
        else if (type == mozISqlResult::TYPE_BOOL)
          aDestCell->mBool = aSrcCell->mBool;
      }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

static Cell* Cell::Create ( nsFixedSizeAllocator &  aAllocator,
PRInt32  aType 
) [inline, static]

Definition at line 119 of file mozSqlResult.h.

                          {
      void* place = aAllocator.Alloc(sizeof(Cell));
      return place ? ::new(place) Cell(aType) : nsnull;
    }

Here is the call graph for this function:

static Cell* Cell::Create ( nsFixedSizeAllocator &  aAllocator,
PRInt32  aType,
Cell aSrcCell 
) [inline, static]

Definition at line 126 of file mozSqlResult.h.

                           {
      void* place = aAllocator.Alloc(sizeof(Cell));
      if (! place)
        return nsnull;
      Cell* newCell = ::new(place) Cell(aType);
      Copy(aSrcCell, newCell);
      return newCell;
    }

Here is the call graph for this function:

static void Cell::Destroy ( nsFixedSizeAllocator &  aAllocator,
Cell aCell 
) [inline, static]

Definition at line 161 of file mozSqlResult.h.

                                                           {
      aCell->~Cell();
      aAllocator.Free(aCell, sizeof(Cell));
    }

Here is the call graph for this function:

Here is the caller graph for this function:

PRInt32 Cell::GetType ( ) [inline]

Definition at line 183 of file mozSqlResult.h.

                      {
      return mType & CELL_FLAG_MASK;
    }

Here is the caller graph for this function:

PRBool Cell::IsDefault ( ) [inline]

Definition at line 203 of file mozSqlResult.h.

                       {
      return mType & CELL_FLAG_DEFAULT;
    }

Here is the caller graph for this function:

PRBool Cell::IsNull ( ) [inline]

Definition at line 199 of file mozSqlResult.h.

                    {
      return mType & CELL_FLAG_NULL;
    }

Here is the caller graph for this function:

static void Cell::operator delete ( void ,
size_t   
) [inline, static, private]

Definition at line 217 of file mozSqlResult.h.

{}
static void* Cell::operator new ( size_t  ) [inline, static, private]

Definition at line 216 of file mozSqlResult.h.

{ return 0; } 
void Cell::SetDefault ( PRBool  aDefault) [inline]

Definition at line 193 of file mozSqlResult.h.

                                     {
      mType &= CELL_FLAG_MASK;
      if (aDefault)
        mType |= CELL_FLAG_DEFAULT;
    }
void Cell::SetNull ( PRBool  aNull) [inline]

Definition at line 187 of file mozSqlResult.h.

                               {
      mType &= CELL_FLAG_MASK;
      if (aNull)
        mType |= CELL_FLAG_NULL;
    }

Here is the caller graph for this function:

void Cell::SetString ( PRUnichar aString) [inline]

Definition at line 177 of file mozSqlResult.h.

                                       {
     if (mString)
        nsMemory::Free(mString);
      mString = aString;
    }

Here is the caller graph for this function:


Member Data Documentation

union { ... }
PRInt8 Cell::mType [private]

Definition at line 219 of file mozSqlResult.h.


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