Class Hierarchy   Class Index   Method Index  

CHMtable Class Reference

#include <CHMtableClass.h>

Inheritance diagram for CHMtable:

CHMmessage

Detailed Description

Table class.

This class gives the interface to the basic data container in the Chameleon framework - a nested in-memory table. A good way to get a quick look at the contents of a Table class is to use the Dump method.


Public Member Functions

 CHMtable ()
 Construct a table.
virtual ~CHMtable ()
 Destructor.
const CHMtableRowoperator[] (size_t RowIndex) const
 Const operator [RowIndex] returns a const pointer to a CHMtableRow object.
CHMtableRowoperator[] (size_t RowIndex)
 Non-const operator [RowIndex] returns a non-const pointer to a CHMtableRow object.
void AddRow ()
 Add a new row to this table.
size_t ColumnIndex (const char *ColumnName) const
 Get the index of the column named ColumnName.
const char * ColumnName (size_t ColumnIndex) const
 Get the name of the column located at ColumnIndex.
CHMdataType ColumnType (size_t ColumnIndex) const
 Get the data type of the column at ColumnIndex.
size_t CountOfColumn () const
 Get the number of columns defined in this table.
size_t CountOfRow () const
 Get the count of rows in this table.
size_t CountOfSubTable () const
 Get the count of subtables in this table.
CHMstring Dump () const
 Output this table's contents to a string.
const CHMdateTime GetDateTime (size_t RowIndex, size_t ColumnIndex) const
 Get the value of a date/time-type column.
double GetDouble (size_t RowIndex, size_t ColumnIndex) const
 Get the value of a double-type column.
long GetInteger (size_t RowIndex, size_t ColumnIndex) const
 Get the value of an integer-type column.
const CHMchar * GetString (size_t RowIndex, size_t ColumnIndex) const
 Get the value of a string-type column.
CHMboolean IsKey (size_t ColumnIndex) const
 Check if the column at ColumnIndex is flagged as a 'key' column.
CHMboolean IsNode () const
 Check if this table corresponds to a table grammar node (true) or a table group (false).
State GetState (size_t RowIndex, size_t ColumnIndex) const
 Test the value in the cell at row RowIndex and column ColumnIndex to see if it is null, zero, empty or invalid.
CHMboolean IsNull (size_t RowIndex, size_t ColumnIndex) const
 Test the value in the cell at row RowIndex and column ColumnIndex to see if it is null.
void SetDateTime (size_t RowIndex, size_t ColumnIndex, const CHMdateTime &DateTime)
 Set the value at row RowIndex and column ColumnIndex of a date/time-type column.
void SetDouble (size_t RowIndex, size_t ColumnIndex, double Value)
 Set the value at row RowIndex and column ColumnIndex of a double-type column.
void SetInteger (size_t RowIndex, size_t ColumnIndex, long Value)
 Set the value at row RowIndex and column ColumnIndex of an integer-type column.
void setNull (size_t RowIndex, size_t ColumnIndex) const
 Set the value at row RowIndex and column ColumnIndex to null.
void SetString (size_t RowIndex, size_t ColumnIndex, const CHMchar *pValue)
 Set the value at row RowIndex and column ColumnIndex of a string-type column.
CHMtableSubTable (size_t RowIndex, size_t SubTableIndex) const
 Get a pointer to the subtable located at SubTableIndex of the table at RowIndex.
CHMtableHandle TableHandle () const
 Get the handle of the underlying table object.
const char * TableName () const
 Get the name of this table.


Constructor & Destructor Documentation

CHMtable::CHMtable  ) 
 

Construct a table.

virtual CHMtable::~CHMtable  )  [virtual]
 

Destructor.


Member Function Documentation

void CHMtable::AddRow  ) 
 

Add a new row to this table.

size_t CHMtable::ColumnIndex const char *  ColumnName  )  const
 

Get the index of the column named ColumnName.

Returns npos = (size_t)-1 if the column does not exist.

const char* CHMtable::ColumnName size_t  ColumnIndex  )  const
 

Get the name of the column located at ColumnIndex.

CHMdataType CHMtable::ColumnType size_t  ColumnIndex  )  const
 

Get the data type of the column at ColumnIndex.

See http://www.interfaceware.com/manual/table_properties.html for more information on table data types.

size_t CHMtable::CountOfColumn  )  const
 

Get the number of columns defined in this table.

size_t CHMtable::CountOfRow  )  const
 

Get the count of rows in this table.

It's important to check this before attempting to access even the first row in case there are no rows in the table.

size_t CHMtable::CountOfSubTable  )  const
 

Get the count of subtables in this table.

CHMstring CHMtable::Dump  )  const
 

Output this table's contents to a string.

This is useful for diagnostics.

const CHMdateTime CHMtable::GetDateTime size_t  RowIndex,
size_t  ColumnIndex
const
 

Get the value of a date/time-type column.

Throws an exception if the data type doesn't match. See http://www.interfaceware.com/manual/table_properties.html for more information on table data types.

double CHMtable::GetDouble size_t  RowIndex,
size_t  ColumnIndex
const
 

Get the value of a double-type column.

Throws an exception if the data type doesn't match. See http://www.interfaceware.com/manual/table_properties.html for more information on table data types.

long CHMtable::GetInteger size_t  RowIndex,
size_t  ColumnIndex
const
 

Get the value of an integer-type column.

Throws an exception if the data type doesn't match. See http://www.interfaceware.com/manual/table_properties.html for more information on table data types.

State CHMtable::GetState size_t  RowIndex,
size_t  ColumnIndex
const
 

Test the value in the cell at row RowIndex and column ColumnIndex to see if it is null, zero, empty or invalid.

See http://interfaceware.com/manual/is_null.html for details.

const CHMchar* CHMtable::GetString size_t  RowIndex,
size_t  ColumnIndex
const
 

Get the value of a string-type column.

Throws an exception if the data type doesn't match. See http://www.interfaceware.com/manual/table_properties.html for more information on table data types.

CHMboolean CHMtable::IsKey size_t  ColumnIndex  )  const
 

Check if the column at ColumnIndex is flagged as a 'key' column.

CHMboolean CHMtable::IsNode  )  const
 

Check if this table corresponds to a table grammar node (true) or a table group (false).

CHMboolean CHMtable::IsNull size_t  RowIndex,
size_t  ColumnIndex
const
 

Test the value in the cell at row RowIndex and column ColumnIndex to see if it is null.

See http://www.interfaceware.com/manual/is_null.html for more information.

This is an alias for GetState(...) == CHM_NULL or GetState(...) == CHM_INVALID

It is recommended not to rely on this function (it is here only for backward compatibility). Use GetState(...) instead.

CHMtableRow* CHMtable::operator[] size_t  RowIndex  ) 
 

Non-const operator [RowIndex] returns a non-const pointer to a CHMtableRow object.

const CHMtableRow* CHMtable::operator[] size_t  RowIndex  )  const
 

Const operator [RowIndex] returns a const pointer to a CHMtableRow object.

void CHMtable::SetDateTime size_t  RowIndex,
size_t  ColumnIndex,
const CHMdateTime DateTime
 

Set the value at row RowIndex and column ColumnIndex of a date/time-type column.

Throws an exception if the data type doesn't match. See http://www.interfaceware.com/manual/table_properties.html for more information on table data types.

void CHMtable::SetDouble size_t  RowIndex,
size_t  ColumnIndex,
double  Value
 

Set the value at row RowIndex and column ColumnIndex of a double-type column.

Throws an exception if the data type doesn't match. See http://www.interfaceware.com/manual/table_properties.html for more information on table data types.

void CHMtable::SetInteger size_t  RowIndex,
size_t  ColumnIndex,
long  Value
 

Set the value at row RowIndex and column ColumnIndex of an integer-type column.

Throws an exception if the data type doesn't match. See http://www.interfaceware.com/manual/table_properties.html for more information on table data types.

void CHMtable::setNull size_t  RowIndex,
size_t  ColumnIndex
const
 

Set the value at row RowIndex and column ColumnIndex to null.

void CHMtable::SetString size_t  RowIndex,
size_t  ColumnIndex,
const CHMchar *  pValue
 

Set the value at row RowIndex and column ColumnIndex of a string-type column.

Throws an exception if the data type doesn't match. See http://www.interfaceware.com/manual/table_properties.html for more information on table data types.

CHMtable* CHMtable::SubTable size_t  RowIndex,
size_t  SubTableIndex
const
 

Get a pointer to the subtable located at SubTableIndex of the table at RowIndex.

CHMtableHandle CHMtable::TableHandle  )  const
 

Get the handle of the underlying table object.

This is used for the internal implementation of this Chameleon and should not be called.

const char* CHMtable::TableName  )  const
 

Get the name of this table.


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