17#ifndef __XB_XBMEMO_H__
18#define __XB_XBMEMO_H__
55class XBDLLEXPORT xbMemo :
public xbFile {
58 xbMemo(
xbDbf *dbf, xbString
const &sFileName );
62 virtual xbInt16 Abort () = 0;
63 virtual xbInt16 CloseMemoFile ();
64 virtual xbInt16 Commit () = 0;
66 #ifdef XB_LOCKING_SUPPORT
67 virtual xbInt16 LockMemo ( xbInt16 iLockFunction );
68 virtual xbBool GetMemoLocked ()
const;
72 virtual xbInt16 CreateMemoFile () = 0;
74 virtual xbInt16 GetMemoField ( xbInt16 iFieldNo, xbString &sMemoData ) = 0;
75 virtual xbInt16 GetMemoFieldLen( xbInt16 iFieldNo, xbUInt32 &ulMemoFieldLen ) = 0;
76 virtual xbInt16 OpenMemoFile () = 0;
77 virtual xbInt16 GetMemoFileType();
78 virtual xbInt16 PackMemo (
void (*memoStatusFunc)(xbUInt32 ulItemNum, xbUInt32 ulNumItems)) = 0;
79 virtual xbInt16 UpdateMemoField( xbInt16 iFieldNo,
const xbString &sMemoData ) = 0;
81 #ifdef XB_DEBUG_SUPPORT
82 virtual xbInt16 DumpMemoFreeChain() = 0;
83 virtual xbInt16 DumpMemoHeader () = 0;
89 virtual xbInt16 CalcLastDataBlock ( xbUInt32 &lLastDataBlock );
90 virtual xbInt16 GetHdrNextBlock ( xbUInt32 &ulBlockNo );
95 virtual xbInt16 ReadDbtHeader ( xbInt16 iOption ) = 0;
96 virtual xbInt16 UpdateHeaderName () = 0;
97 virtual xbInt16 UpdateHeadNextNode();
98 virtual xbInt16 Zap () = 0;
102 xbInt16 iMemoFileType;
103 xbUInt32 ulHdrNextBlock;
109 #ifdef XB_LOCKING_SUPPORT
117#ifdef XB_DBF3_SUPPORT
131class XBDLLEXPORT xbMemoDbt3 :
public xbMemo {
133 xbMemoDbt3(
xbDbf *dbf, xbString
const &sFileName );
135 virtual xbInt16 Abort ();
136 virtual xbInt16 Commit ();
137 virtual xbInt16 CreateMemoFile ();
138 virtual xbInt16 GetMemoField ( xbInt16 iFieldNo, xbString &sMemoData );
139 virtual xbInt16 GetMemoFieldLen( xbInt16 iFieldNo, xbUInt32 &ulMemoFieldLen );
140 virtual xbInt16 OpenMemoFile ();
141 virtual xbInt16 PackMemo (
void (*memoStatusFunc) (xbUInt32 ulItemNum, xbUInt32 ulNumItems));
142 virtual xbInt16 UpdateMemoField( xbInt16 iFieldNo,
const xbString &sMemoData );
144 #ifdef XB_DEBUG_SUPPORT
145 virtual xbInt16 DumpMemoFreeChain();
146 virtual xbInt16 DumpMemoHeader ();
150 virtual xbInt16 ReadDbtHeader( xbInt16 iOption );
151 virtual xbInt16 UpdateHeaderName();
152 virtual xbInt16 Zap();
159#ifdef XB_DBF4_SUPPORT
172class XBDLLEXPORT xbMemoDbt4 :
public xbMemo {
174 xbMemoDbt4(
xbDbf *dbf, xbString
const &sFileName );
176 virtual xbInt16 Abort ();
177 virtual xbInt16 Commit ();
178 virtual xbInt16 CreateMemoFile ();
180 virtual xbInt16 GetMemoField ( xbInt16 iFieldNo, xbString &sMemoData );
181 virtual xbInt16 GetMemoFieldLen ( xbInt16 iFieldNo, xbUInt32 &ulMemoFieldLen );
182 virtual xbInt16 GetMemoFieldLen ( xbInt16 iFieldNo, xbUInt32 &ulMemoFieldLen, xbUInt32 &lBlockNo );
183 virtual xbInt16 OpenMemoFile ();
184 virtual xbInt16 PackMemo (
void (*memoStatusFunc) (xbUInt32 ulItemNum, xbUInt32 ulNumItems));
185 virtual xbInt16 UpdateMemoField ( xbInt16 iFieldNo,
const xbString &sMemoData );
187 #ifdef XB_DEBUG_SUPPORT
188 virtual xbInt16 DumpMemoFreeChain ();
189 virtual xbInt16 DumpMemoHeader ();
190 virtual xbInt16 DumpMemoInternals ();
191 virtual xbInt16 ReadFreeBlockHeader( xbUInt32 ulBlockNo, xbUInt32 &ulNextBlock, xbUInt32 &ulFreeBlockCnt );
195 virtual xbInt16 FindBlockSetInChain( xbUInt32 ulBlocksNeeded, xbUInt32 &ulLastDataBlock, xbUInt32 &ulLocation, xbUInt32 &ulPrevNode,
xbBool &bFound );
196 virtual xbInt16 FreeMemoBlockChain( xbUInt32 ulBlockNo );
197 virtual xbInt16 FreeMemoBlockChain( xbUInt32 ulBlockNo, xbUInt32 &ulLastDataBlock );
198 virtual xbInt16 GetBlockSetFromChain( xbUInt32 ulBlocksNeeded, xbUInt32 ulLocation, xbUInt32 ulPrevNode );
199 virtual xbInt16 ReadDbtHeader( xbInt16 iOption );
200 virtual xbInt16 ReadBlockHeader( xbUInt32 ulBlockNo, xbInt16 iOption );
201 virtual xbInt16 UpdateHeaderName ();
202 virtual xbInt16 WriteBlockHeader( xbUInt32 ulBlockNo, xbInt16 iOption );
203 virtual xbInt16 Zap();
206 xbString sDbfFileNameWoExt;
207 xbUInt32 ulNextFreeBlock;
208 xbUInt32 ulFreeBlockCnt;
213 xbLinkList<xbUInt32> llOldBlocks;
214 xbLinkList<xbUInt32> llNewBlocks;
Definition: xbdate.cpp:19
short int xbBool
Definition: xbtypes.h:24
class XBDLLEXPORT xbDbf
Definition: xbtblmgr.h:28