Xbase64 Class Library
3.1.2
Main Page
Classes
Files
File List
File Members
xbase64
xbindex.h
Go to the documentation of this file.
1
/* xbindex.h
2
3
Xbase64 project source code
4
5
This file contains a header file for the NTX object, which is used
6
for handling NTX type indices. NTX are the Clipper equivalant of xbNdx
7
files.
8
9
Copyright (C) 1998 SynXis Corp., Bob Cotton
10
11
This program is free software; you can redistribute it and/or modify
12
it under the terms of the GNU Lesser General Public License as published by
13
the Free Software Foundation; either version 2 of the License, or
14
(at your option) any later version.
15
16
This program is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
GNU Lesser General Public License for more details.
20
21
You should have received a copy of the GNU Lesser General Public License
22
along with this program; if not, write to the Free Software
23
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
25
26
Contact:
27
28
Email:
29
30
xdb-devel@lists.sourceforge.net
31
xdb-users@lists.sourceforge.net
32
33
34
Regular Mail:
35
36
XBase Support
37
149C South Main St
38
Keller Texas, 76248
39
USA
40
41
*/
42
43
#ifndef __XB_INDEX_H__
44
#define __XB_INDEX_H__
45
46
#ifdef __GNU_LesserG__
47
#pragma interface
48
#endif
49
50
#include <
xbase64/xbase64.h
>
51
#include <string.h>
55
#define XB_UNIQUE 1
56
#define XB_NOT_UNIQUE 0
57
59
62
class
XBDLLEXPORT
xbIndex
:
protected
xbFile
63
{
64
public
:
65
xbIndex
() {}
66
xbIndex
(
xbDbf
*);
67
68
virtual
~
xbIndex
();
69
70
xbShort
OpenIndex (
const
char
* );
71
xbShort
CloseIndex();
72
virtual
xbShort
CreateIndex(
const
char
*,
const
char
*,
xbShort
,
xbShort
) = 0;
73
virtual
xbLong
GetTotalNodes() = 0;
74
virtual
xbULong
GetCurDbfRec() = 0;
75
virtual
xbShort
CreateKey(
xbShort
,
xbShort
) = 0;
76
virtual
xbShort
GetCurrentKey(
char
*key) = 0;
77
virtual
xbShort
AddKey(
xbLong
) = 0;
78
virtual
xbShort
UniqueIndex() = 0;
79
virtual
xbShort
DeleteKey(
xbLong
) = 0;
80
virtual
xbShort
KeyWasChanged() = 0;
81
virtual
xbShort
FindKey(
const
char
* ) = 0;
82
virtual
xbShort
FindKey() = 0;
83
virtual
xbShort
FindKey(
xbDouble
) = 0;
84
virtual
xbShort
GetNextKey() = 0;
85
virtual
xbShort
GetLastKey() = 0;
86
virtual
xbShort
GetFirstKey() = 0;
87
virtual
xbShort
GetPrevKey() = 0;
88
virtual
xbShort
ReIndex(
void
(*statusFunc)(
xbLong
itemNum,
xbLong
numItems) = 0) = 0;
89
// virtual xbShort KeyExists( char * Key ) { return FindKey( Key, strlen( Key ), 0 ); }
90
virtual
xbShort
KeyExists(
xbDouble
) = 0;
91
virtual
xbShort
TouchIndex
() {
return
XB_NO_ERROR
; }
92
virtual
void
SetNodeSize
(
xbShort
size) {}
93
virtual
xbShort
GetNodeSize
() {
return
NodeSize; }
94
virtual
void
GetExpression(
char
*buf,
int
len) = 0;
95
virtual
void
Flush();
96
virtual
const
char
*
GetIxName
() {
return
GetFileName
().
getData
();}
97
xbShort
AllocKeyBufs();
98
xbBool
IsOpen
() {
return
indexfp!=NULL;}
99
100
#ifdef XBASE_DEBUG
101
virtual
void
DumpHdrNode(
xbShort
Option ) = 0;
102
virtual
void
DumpNodeRec(
xbLong
) = 0;
103
virtual
void
DumpNodeChain() = 0;
104
virtual
xbShort
CheckIndexIntegrity(
xbShort
) = 0;
105
#endif
106
107
#ifdef XB_LOCKING_ON
108
// xbShort LockIndex( xbShort LockType );
109
// virtual xbShort LockIndex( const xbShort, const xbShort );
110
#else
111
// virtual xbShort LockIndex( const xbShort, const xbShort ) const { return XB_NO_ERROR; }
112
#endif
113
114
protected
:
115
virtual
xbShort
GetHeadNode()=0;
116
virtual
xbUShort
GetKeyLen()=0;
117
virtual
const
char
* GetKeyExpression()=0;
118
virtual
void
FreeNodesMemory()=0;
119
120
xbIndex
*
index
;
121
xbDbf
*
dbf
;
122
xbExpn *
IxExp
;
/* index expression defines keys */
123
FILE *
indexfp
;
124
/* NULL = closed, other = open */
125
// int IndexStatus; /* old - 0 = closed, 1 = open */
126
xbULong
CurDbfRec
;
/* current Dbf record number */
127
char
*
KeyBuf
;
/* work area key buffer */
128
char
*
KeyBuf2
;
/* work area key buffer */
129
xbShort
NodeSize
;
130
131
#ifdef XB_LOCKING_ON
132
int
LockCnt;
/* current index lock count */
133
int
CurLockCount;
/* old locking field */
134
int
CurLockType;
/* old locking field */
135
#endif
136
};
137
138
139
#endif
/* __XB_INDEX_H__ */
Generated by
1.8.1.1