Index Overview
Chapter Updated 04/29/23
File Type | Source | Max Tags Per File | Auto Opened | Sort Order | Unique Keys | Reclaimed Nodes | Filter Support | Status |
---|---|---|---|---|---|---|---|---|
NDX | dBase | ASC only | ||||||
MDX | dBase | |||||||
NTX | Clipper | |||||||
CDX | Fox Pro | |||||||
IDX | Fox Pro | Pending development | ||||||
Method | Description |
---|---|
xbInt16 xbDbf::CheckTagIntegrity( xbInt16 iTagOpt, xbInt16 iOutputOpt ) | Checks a tag for missing or duplicate entries. Available if XB_DEBUG_SUPPORT is on. |
xbInt16 xbDbf::CloseIndexFile( xbIx *pIx ) | Close an index file. Indices are automatically closed when the table is closed.
Not typically called in an application program. |
xbInt16 xbDbf::CreateTag( const xbString &sIxType, const xbString &sName, const xbString &sKey, const xbString &sFilter, xbInt16 iDescending, xbInt16 iUnique, xbInt16 iOverLay, xbIx **xbIxOut, void **vpTagOut ); | Create a new tag. |
xbInt16 xbDbf::DeleteTag( const xbString &sIxType, const xbString &sName ) | Delete existing tag. |
xbInt16 xbDbf::Find( xbString &sKey ) xbInt16 xbDbf::Find( xbDate &dtKey ) xbInt16 xbDbf::Find( xbDouble &dKey ) | Find key value for the active tag. |
xbIx * xbDbf::GetCurIx() const | Returns a pointer to the current index object. | xbString & xbDbf::GetCurIxType() const | Returns the current index type. | void * xbDbf::GetCurTag() const | Retrieve pointer to the current active tag. |
const xbString & xbDbf::GetCurTagName() const | Returns the current tag name. | xbInt16 xbDbf::GetFirstKey() | Retrieve the first key for the active tag. |
xbIxList * xbDbf::GetIxList() const | Returns a pointer to the list of active indices. |
xbInt16 xbDbf::GetLastKey() | Retrieve the last key for the active tag. |
xbInt16 xbDbf::GetNextKey() | Retrieve the next key for the active tag. |
xbInt32 xbDbf::GetPhysicalIxCnt() const | Returns count of number of physical files opened for DBF table. |
xbInt16 xbDbf::GetPrevKey() | Retrieve the previous key for the active tag. |
xbLinkListNode | Returns pointer to linked list of open tags for the DBF file/table. |
xbInt16 xbDbf::OpenIndex( const xbString &sIxType, const xbString &sIndexName ) | Open an index file. Only used for index files that aren't automatically opened. |
xbInt16 xbDbf::Reindex( xbInt16 iTagOpt ) | Rebuild a tag. Available if XB_DEBUG_SUPPORT is on. |
xbInt16 xbDbf::SetCurTag( const xbString &sTagName ) void xbDbf::SetCurTag( const xbString &sIxType, xbIx *pIx, void *vpTag ) | Set current tag. |
Type | Stored in DBF as | Stored in NDX as | Stored in MDX as |
---|---|---|---|
C | Character data | Character data | Character data |
F | Text numbers | xbDouble | xbBcd |
N | Text numbers | xbDouble | xbBcd |
D | Text YYYYMMDD | xbDouble Julian | xbDouble Julian |
Type | Size | Field Name | Description |
---|---|---|---|
xbLong | 4 | StartNode | This identifies the root node of the index. The Header node is node 0. |
xbLong | 4 | Total Nodes | This is the count of the total nodes in the index. The count includes the header node. |
xbLong | 4 | NoOfKeys | Total number of keys in the index +1 |
xbUShort | 2 | KeyLen | The index key length |
xbUShort | 2 | KeysPerNode | The maximum number of keys per node |
xbUShort | 2 | KeyType | Type of key 00 - Character 01 - Numeric |
xbLong | 4 | Keysize | Key record size + 8 |
char | 1 | Unknown | Reserved |
char | 1 | Unique | Unique indicator 00 - Not Unique - XB_NON_UNIQUE 01 - Unique - XB_UNIQUE |
char | 488 | KeyExpression | Key expression string |
512 | Total bytes in node |
Type | Size | Field Name | Description |
---|---|---|---|
xbLong | 4 | NoOfKeysThisNode | The number of key values in this node. |
char | 508 | KeyRec | A repeating structure of pointers and keys. See the next table for the KeyRec structure. |
Type | Size | Field Name | Description |
---|---|---|---|
xbLong | 4 | LeftNodeNo | The node number of the lower node for this key. 0 in Leaf Nodes. |
xbLong | 4 | DbfRecNo | The DBF record number for this key. 0 in Interior Nodes. |
char | KeyLen | KeyValue | The key value. |