summaryrefslogtreecommitdiff
path: root/1Tdata/xbase/xbase64-4.1.4/src/include/xbtblmgr.h
blob: 2c31e4575df15f38696274aa045cb13178456437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*  xbtblmgr.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

This class manages a list of open tables, open indices are connected to the open tables

*/


#ifndef __XB_XBMGR_H__
#define __XB_XBMGR_H__

#ifdef  CMAKE_COMPILER_IS_GNUCC
#pragma interface
#endif

namespace xb{

class XBDLLEXPORT xbDbf;

/* this structure is a linked list of open tables */
struct XBDLLEXPORT xbTblList{
  xbTblList *pNext;
  xbString  *psFqTblName;          // Fully qualified name of table - same table can be opened multiple times, but must have unique alias
  xbString  *psTblName;            // Table name without path, without extension
  xbString  *psTblAlias;           // TblAliasName must be unique, same as TblNAme if Alias not provided
  xbDbf     *pDbf;
};

class XBDLLEXPORT xbTblMgr : public xbSsv {
 public:
  xbTblMgr();
  ~xbTblMgr();
  xbInt16     AddTblToTblList        ( xbDbf *d, const xbString &sFqTblName );
  xbInt16     AddTblToTblList        ( xbDbf *d, const xbString &sFqTblName, const xbString &sTblAlias );
  xbInt16     DisplayTableList       () const;
  xbDbf *     GetDbfPtr              ( const xbString &sTblAlias ) const;
  xbDbf *     GetDbfPtr              ( xbInt16 sItemNo ) const;
  xbTblList * GetTblListEntry        ( xbDbf *d );
  xbInt16     GetOpenTableCount      () const;
  xbInt16     RemoveTblFromTblList   ( const xbString &sTblAlias );
  xbInt16     RemoveTblFromTblList   ( xbDbf *d );

 protected:

 private:
  xbTblList  * TblList;          // List of open database tables
  xbInt16    iOpenTableCount;    // Number of open tables

};

}        /* namespace xb   */

#endif   /* __XB_XBMGR_H__ */