1 | /************** FilAMFix H Declares Source Code File (.H) **************/ |
2 | /* Name: FILAMFIX.H Version 1.3 */ |
3 | /* */ |
4 | /* (C) Copyright to the author Olivier BERTRAND 2005 - 2014 */ |
5 | /* */ |
6 | /* This file contains the FIX file access method classes declares. */ |
7 | /***********************************************************************/ |
8 | |
9 | #ifndef __FILAMFIX_H |
10 | #define __FILAMFIX_H |
11 | |
12 | #include "filamtxt.h" |
13 | |
14 | typedef class FIXFAM *PFIXFAM; |
15 | typedef class BGXFAM *PBGXFAM; |
16 | |
17 | /***********************************************************************/ |
18 | /* This is the DOS/UNIX Access Method class declaration for standard */ |
19 | /* files with fixed record format (FIX, BIN) */ |
20 | /***********************************************************************/ |
21 | class DllExport FIXFAM : public BLKFAM { |
22 | public: |
23 | // Constructor |
24 | FIXFAM(PDOSDEF tdp); |
25 | FIXFAM(PFIXFAM txfp); |
26 | |
27 | // Implementation |
28 | virtual AMT GetAmType(void) {return TYPE_AM_FIX;} |
29 | virtual PTXF Duplicate(PGLOBAL g) |
30 | {return (PTXF)new(g) FIXFAM(this);} |
31 | |
32 | // Methods |
33 | virtual int Cardinality(PGLOBAL g) {return TXTFAM::Cardinality(g);} |
34 | virtual int MaxBlkSize(PGLOBAL g, int s) |
35 | {return TXTFAM::MaxBlkSize(g, s);} |
36 | virtual bool SetPos(PGLOBAL g, int recpos); |
37 | virtual int GetNextPos(void) {return Fpos + 1;} |
38 | virtual bool AllocateBuffer(PGLOBAL g); |
39 | virtual void ResetBuffer(PGLOBAL g); |
40 | virtual int WriteModifiedBlock(PGLOBAL g); |
41 | virtual int ReadBuffer(PGLOBAL g); |
42 | virtual int WriteBuffer(PGLOBAL g); |
43 | virtual int DeleteRecords(PGLOBAL g, int irc); |
44 | virtual void CloseTableFile(PGLOBAL g, bool abort); |
45 | |
46 | protected: |
47 | virtual bool (PGLOBAL g) {return false;} |
48 | virtual bool MoveIntermediateLines(PGLOBAL g, bool *b); |
49 | virtual int InitDelete(PGLOBAL g, int fpos, int spos); |
50 | |
51 | // No additional members |
52 | }; // end of class FIXFAM |
53 | |
54 | |
55 | /***********************************************************************/ |
56 | /* This is the DOS/UNIX Access Method class declaration for files */ |
57 | /* that are standard files with columns starting at fixed offset */ |
58 | /* This class is for fixed formatted files of more than 2 gigabytes. */ |
59 | /***********************************************************************/ |
60 | class BGXFAM : public FIXFAM { |
61 | public: |
62 | // Constructor |
63 | BGXFAM(PDOSDEF tdp); |
64 | BGXFAM(PBGXFAM txfp); |
65 | |
66 | // Implementation |
67 | virtual PTXF Duplicate(PGLOBAL g) |
68 | {return (PTXF)new(g) BGXFAM(this);} |
69 | |
70 | // Methods |
71 | virtual int Cardinality(PGLOBAL g); |
72 | virtual bool OpenTableFile(PGLOBAL g); |
73 | virtual int WriteModifiedBlock(PGLOBAL g); |
74 | virtual int ReadBuffer(PGLOBAL g); |
75 | virtual int WriteBuffer(PGLOBAL g); |
76 | virtual int DeleteRecords(PGLOBAL g, int irc); |
77 | virtual void CloseTableFile(PGLOBAL g, bool abort); |
78 | virtual void Rewind(void); |
79 | |
80 | protected: |
81 | virtual bool OpenTempFile(PGLOBAL g); |
82 | virtual bool MoveIntermediateLines(PGLOBAL g, bool *b = NULL); |
83 | int BigRead(PGLOBAL g, HANDLE h, void *inbuf, int req); |
84 | bool BigWrite(PGLOBAL g, HANDLE h, void *inbuf, int req); |
85 | bool BigSeek(PGLOBAL g, HANDLE h, BIGINT pos |
86 | , int org = FILE_BEGIN); |
87 | |
88 | // Members |
89 | HANDLE Hfile; // Handle(descriptor) to big file |
90 | HANDLE Tfile; // Handle(descriptor) to big temp file |
91 | }; // end of class BGXFAM |
92 | |
93 | #endif // __FILAMFIX_H |
94 | |