// Methods bool DefineAM(PGLOBAL g, LPCSTR am, int poff) override;
PTDB GetTable(PGLOBAL g, MODE m) override;
protected: // Members char *Fn; /* Path/Name of corresponding file */ char *Xname; /* The eventual table name */ char Layout; /* R: Row, C: Column */ int Ln; /* Length of section list buffer */
}; // end of INIDEF
/***********************************************************************/ /* This is the class declaration for the INI tables. */ /* These are tables represented by a INI like file. */ /***********************************************************************/ class TDBINI : public TDBASE { friendclass INICOL; public: // Constructor
TDBINI(PINIDEF tdp);
TDBINI(PTDBINI tdbp);
// Database routines
PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; int Cardinality(PGLOBAL g) override; int GetMaxSize(PGLOBAL g) override; bool OpenDB(PGLOBAL g) override; int ReadDB(PGLOBAL g) override; int WriteDB(PGLOBAL g) override; int DeleteDB(PGLOBAL g, int irc) override; void CloseDB(PGLOBAL g) override;
protected: // Members
PCSZ Ifile; // The INI file char *Seclist; // The section list char *Section; // The current section int Seclen; // Length of seclist buffer int N; // The current section index
}; // end of class TDBINI
/***********************************************************************/ /* Class INICOL: XDB table access method column descriptor. */ /***********************************************************************/ class INICOL : public COLBLK { public: // Constructors
INICOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "INI");
INICOL(INICOL *colp, PTDB tdbp); // Constructor used in copy process
protected: // Default constructor not to be used
INICOL(void) = default;
// Members char *Valbuf; // To the key value buffer int Flag; // Tells what set in value intLong; // Buffer length
PVAL To_Val; // To value used for Update/Insert
}; // end of class INICOL
/* --------------------------- XINI class ---------------------------- */
/***********************************************************************/ /* This is the class declaration for the XINI tables. */ /* These are tables represented by a INI like file */ /* having 3 columns Section, Key, and Value. */ /***********************************************************************/ class TDBXIN : public TDBINI { friendclass XINCOL; public: // Constructor
TDBXIN(PINIDEF tdp);
TDBXIN(PTDBXIN tdbp);
// Database routines
PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n) override; int Cardinality(PGLOBAL g) override; bool OpenDB(PGLOBAL g) override; int ReadDB(PGLOBAL g) override; int WriteDB(PGLOBAL g) override; int DeleteDB(PGLOBAL g, int irc) override;
protected: // Members char *Keylist; // The key list char *Keycur; // The current key int Keylen; // Length of keylist buffer short Oldsec; // Last current section
}; // end of class TDBXIN
/***********************************************************************/ /* Class XINCOL: XIN table access method column descriptor. */ /***********************************************************************/ class XINCOL : public INICOL { public: // Constructors
XINCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am = "INI");
XINCOL(XINCOL *colp, PTDB tdbp); // Constructor used in copy process