diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-08-14 21:07:46 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-08-14 21:07:46 +0200 |
commit | c894a7cdd8686ea695602a23a511a3f1b0d047be (patch) | |
tree | 1fb4e9f4781af3221982a5831173ea14e6585306 /src/include/xbblkread.h | |
parent | bfa452a375ea0a0a3f95304a69186936567e5263 (diff) |
New upstream version 4.1.4upstream
Diffstat (limited to 'src/include/xbblkread.h')
-rwxr-xr-x | src/include/xbblkread.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/include/xbblkread.h b/src/include/xbblkread.h new file mode 100755 index 0000000..353c618 --- /dev/null +++ b/src/include/xbblkread.h @@ -0,0 +1,70 @@ +/* xbblkread.h + +XBase64 Software Library + +Copyright (c) 1997,2003,2014,2022 Gary A Kunkel + +The xb64 software library is covered under the terms of the GPL Version 3, 2007 license. + +Email Contact: + + XDB-devel@lists.sourceforge.net + XDB-users@lists.sourceforge.net + +*/ + +#ifndef __XB_BLKREAD_H__ +#define __XB_BLKREAD_H__ + +namespace xb{ +#ifdef XB_BLOCKREAD_SUPPORT + + + +//! @brief xbBlockRead class. +/*! +The xbBlockRead class can be used to read blocks of records at one time +rather than one record at a time for perfomance improvements when reading a DBF file sequentially.<br> + +*/ + + +class XBDLLEXPORT xbBlockRead { + + public: + xbBlockRead( xbDbf * d ); + ~xbBlockRead(); + + #ifdef XB_DEBUG_SUPPORT + void DumpReadBlockInternals(); + #endif + + xbInt16 Init( xbUInt32 ulBlkSize = 0 ); + + xbUInt32 GetBlockFirstRecNo() const; + xbUInt32 GetBlockRecCnt() const; + xbUInt32 GetBlockSize() const; + + xbInt16 GetRecord( xbUInt32 ulRecNo ); // retrieve a data record from a block to RecBuf + xbInt16 SetBlockSize( xbUInt32 ulBlkSize ); + + + private: + + xbInt16 GetBlockForRecNo( xbUInt32 ulRecNo ); // retrieve block from disk for a given record number + + char *pBlock; // block pointer + xbUInt32 ulBlkSize; // block size in bytes + xbUInt32 ulFirstBlkRec; // first recod number in the block + xbUInt32 ulRecCnt; // number of records in block + xbUInt32 ulMaxRecs; // max number of records block can handle + xbBool bEof; // EOF flag + xbDbf *dbf; // reference to associated dbf file +// xbXBase *xbase; // reference to main xbXBase structure + time_t tFmTime; // file modify time at time of block read + +}; + +#endif // XB_BLOCKREAD +} /* namespace */ +#endif /* __XB_BLOCKREAD_H__ */ |