vdkxdb 2.4.0
Public Member Functions | Public Attributes | Protected Attributes | List of all members
VDKXTable Class Reference

Provides a xbDbf wrapper. More...

#include <vdkxtable.h>

Inherits xbDbf.

Collaboration diagram for VDKXTable:
Collaboration graph
[legend]

Public Member Functions

void SetOrder (char *name)
 
 VDKXTable (VDKXDatabase *owner, char *name)
 
virtual ~VDKXTable ()
 Destructor.
 
VDKString Name ()
 Returns table name.
 
xbShort Create (VDKXRecordTemplate *tpl, bool overwrite=false)
 
xbShort Open (void)
 
xbShort Close (void)
 
bool RemoveIndex (char *name)
 
VDKXTableIndexIndex (char *name)
 
VDKXTableIndexIndex (xbShort order)
 
xbShort First ()
 
xbShort Last ()
 
xbShort Next ()
 
xbShort Prev ()
 
IndexList * NdxList ()
 /internal
 
bool IsOpen ()
 return if table is open or not
 

Public Attributes

VDKReadOnlyValueProp< VDKXTable, xbLong > Size
 table size in records
 
VDKReadWriteValueProp< VDKXTable, xbShort > Order
 
VDKReadWriteValueProp< VDKXTable, bool > ShowDeleted
 

Protected Attributes

VDKString name
 table name
 
IndexList iList
 indexes list
 

Detailed Description

Provides a xbDbf wrapper.

Since it is a derived class of xbDbf, most behaviours are inherited. Refer to xdb reference for further informations.

Constructor & Destructor Documentation

◆ VDKXTable()

VDKXTable::VDKXTable ( VDKXDatabase owner,
char *  name 
)

Constructor

Parameters
ownerowner xdb
nametable name can be either with or without .dbf extension

Member Function Documentation

◆ Close()

xbShort VDKXTable::Close ( void  )

Close table and all associated indexes. Returns:

  • XB_NO_ERROR no errors
  • XB_NOT_OPEN file wasn't opened

◆ Create()

xbShort VDKXTable::Create ( VDKXRecordTemplate *  tpl,
bool  overwrite = false 
)

Creates a table

Parameters
tpla VDKXRecordTemplate
overwriteif true and table exist will be truncated and overwritten. Returns:
  • XB_NO_ERROR no errors
  • XB_FILE_EXISTS file exist and overwrite flag = false
  • XB_OPEN_ERROR couldn't open file
  • XB_NO_MEMORY mem allocation error
  • XB_WRITE_ERROR couldn't write on device

◆ First()

xbShort VDKXTable::First ( )

Moves database pointer to first logical record. If there is no active index moves on first phisical record If ShowDeleted property is fale (default)moves to first logical/phisical undeleted record. Returns:

  • XB_NO_ERROR no errors
  • XB_INVALID_RECORD invalid record number
  • XB_LOCK_FAILED couldn't lock file
  • XB_NOT_OPEN file not open
  • XB_SEEK_ERROR seek routine error
  • XB_WRITE_ERROR couldn't write

◆ Index() [1/2]

VDKXTableIndex * VDKXTable::Index ( char *  name)

Returns an index given a name

Parameters
nameindex name Returns (VDKXTableIndex*) NULL on failure

◆ Index() [2/2]

VDKXTableIndex * VDKXTable::Index ( xbShort  order)

Returns an index given an ordinal position

Parameters
orderindex ordinal position Returns (VDKXTableIndex*) NULL on failure

◆ Last()

xbShort VDKXTable::Last ( )

Moves database pointer to last logical record If there is no active index moves on last phisical record If ShowDeleted property is fale (default)moves to last logical/phisical undeleted record. Returns:

  • XB_NO_ERROR no errors
  • XB_INVALID_RECORD invalid record number
  • XB_LOCK_FAILED couldn't lock file
  • XB_NOT_OPEN file not open
  • XB_SEEK_ERROR seek routine error
  • XB_WRITE_ERROR couldn't write

◆ Next()

xbShort VDKXTable::Next ( )

Moves database pointer to next logical record If there is no active index moves on next phisical record If ShowDeleted property is fale (default)moves to next logical/phisical undeleted record. Returns:

  • XB_NO_ERROR no errors
  • XB_INVALID_RECORD invalid record number
  • XB_LOCK_FAILED couldn't lock file
  • XB_NOT_OPEN file not open
  • XB_SEEK_ERROR seek routine error
  • XB_WRITE_ERROR couldn't write

◆ Open()

xbShort VDKXTable::Open ( void  )

Opens table. Returns:

  • XB_NO_ERROR no errors
  • XB_OPEN_ERROR couldn't open file
  • XB_NO_MEMORY mem allocation error
  • XB_WRITE_ERROR couldn't write on device
  • XB_NOT_XBASE not an xdb file type

◆ Prev()

xbShort VDKXTable::Prev ( )

Moves database pointer to previous logical record If there is no active index moves on previous phisical record If ShowDeleted property is fale (default)moves to previous logical/phisical undeleted record. Returns:

  • XB_NO_ERROR no errors
  • XB_INVALID_RECORD invalid record number
  • XB_LOCK_FAILED couldn't lock file
  • XB_NOT_OPEN file not open
  • XB_SEEK_ERROR seek routine error
  • XB_WRITE_ERROR couldn't write

◆ RemoveIndex()

bool VDKXTable::RemoveIndex ( char *  name)

Removes an index from table

Parameters
nameindex name. Returns true on success

◆ SetOrder()

void VDKXTable::SetOrder ( char *  name)

sets/gets active index Setting Order to NULL no active index will be used.

Parameters
nameindex file name

Member Data Documentation

◆ Order

VDKReadWriteValueProp<VDKXTable,xbShort> VDKXTable::Order

sets/gets active index ordinal position. Setting Order to -1 no active index will be used.

◆ ShowDeleted

VDKReadWriteValueProp<VDKXTable,bool> VDKXTable::ShowDeleted

If false all record marked for deletion will be ignored on common table operations.


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