Xbase64 4.0.1
C++ Library for handling Xbase (DBF) format type files
xbblkread.h
Go to the documentation of this file.
1/* xbblkread.h
2
3XBase64 Software Library
4
5Copyright (c) 1997,2003,2014,2022 Gary A Kunkel
6
7The xb64 software library is covered under the terms of the GPL Version 3, 2007 license.
8
9Email Contact:
10
11 XDB-devel@lists.sourceforge.net
12 XDB-users@lists.sourceforge.net
13
14*/
15
16#ifndef __XB_BLKREAD_H__
17#define __XB_BLKREAD_H__
18
19namespace xb{
20#ifdef XB_BLOCKREAD_SUPPORT
21
22
23
25
32class XBDLLEXPORT xbBlockRead {
33
34 public:
35 xbBlockRead( xbDbf * d );
36 ~xbBlockRead();
37
38 #ifdef XB_DEBUG_SUPPORT
39 void DumpReadBlockInternals();
40 #endif
41
42 xbInt16 Init( xbUInt32 ulBlkSize = 0 );
43
44 xbUInt32 GetBlockFirstRecNo() const;
45 xbUInt32 GetBlockRecCnt() const;
46 xbUInt32 GetBlockSize() const;
47
48 xbInt16 GetRecord( xbUInt32 ulRecNo ); // retrieve a data record from a block to RecBuf
49 xbInt16 SetBlockSize( xbUInt32 ulBlkSize );
50
51
52 private:
53
54 xbInt16 GetBlockForRecNo( xbUInt32 ulRecNo ); // retrieve block from disk for a given record number
55
56 char *pBlock; // block pointer
57 xbUInt32 ulBlkSize; // block size in bytes
58 xbUInt32 ulFirstBlkRec; // first recod number in the block
59 xbUInt32 ulRecCnt; // number of records in block
60 xbUInt32 ulMaxRecs; // max number of records block can handle
61 xbBool bEof; // EOF flag
62 xbDbf *dbf; // reference to associated dbf file
63// xbXBase *xbase; // reference to main xbXBase structure
64 time_t tFmTime; // file modify time at time of block read
65
66};
67
68#endif // XB_BLOCKREAD
69} /* namespace */
70#endif /* __XB_BLOCKREAD_H__ */
Definition: xbdate.cpp:19
short int xbBool
Definition: xbtypes.h:24
class XBDLLEXPORT xbDbf
Definition: xbtblmgr.h:28