summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rwxr-xr-xsrc/include/xbase.h2
-rwxr-xr-xsrc/include/xbbcd.h2
-rwxr-xr-xsrc/include/xbconfig.h.in2
-rwxr-xr-xsrc/include/xbdbf.h51
-rwxr-xr-xsrc/include/xbfile.h1
-rwxr-xr-xsrc/include/xbmemo.h41
-rwxr-xr-xsrc/include/xbsql.h26
-rwxr-xr-xsrc/include/xbssv.h3
-rwxr-xr-xsrc/include/xbstring.h5
-rwxr-xr-xsrc/include/xbtblmgr.h17
10 files changed, 85 insertions, 65 deletions
diff --git a/src/include/xbase.h b/src/include/xbase.h
index 33d2dc9..480d716 100755
--- a/src/include/xbase.h
+++ b/src/include/xbase.h
@@ -58,8 +58,10 @@ Email Contact:
#endif
#ifdef HAVE_VARARGS_H
+#ifndef HAVE_STDARG_H
#include <varargs.h>
#endif
+#endif
#ifdef HAVE_WINDOWS_H
#include <windows.h>
diff --git a/src/include/xbbcd.h b/src/include/xbbcd.h
index f94ed01..8c931d3 100755
--- a/src/include/xbbcd.h
+++ b/src/include/xbbcd.h
@@ -65,8 +65,6 @@ class XBDLLEXPORT xbBcd {
// const unsigned char * GetBcd() const;
void StringToBcd( const xbString &sStringIn );
-// void StringToBcdOld( const xbString &sStringIn );
-
xbInt16 Compare( const xbBcd &bcdIn );
xbInt16 Compare( xbDouble d );
diff --git a/src/include/xbconfig.h.in b/src/include/xbconfig.h.in
index b749ff2..969b761 100755
--- a/src/include/xbconfig.h.in
+++ b/src/include/xbconfig.h.in
@@ -98,7 +98,7 @@
#cmakedefine XB_NDX_SUPPORT
#cmakedefine XB_MDX_SUPPORT
#cmakedefine XB_SQL_SUPPORT
-#cmakedefine XB_NDXINF_SUPPORT
+#cmakedefine XB_INF_SUPPORT
#cmakedefine XB_FILTER_SUPPORT
#cmakedefine XB_UTILS_SUPPORT
diff --git a/src/include/xbdbf.h b/src/include/xbdbf.h
index 710dd14..c0842cb 100755
--- a/src/include/xbdbf.h
+++ b/src/include/xbdbf.h
@@ -179,17 +179,20 @@ class XBDLLEXPORT xbDbf : public xbFile {
virtual xbInt16 GetNextRecord ();
virtual xbInt16 GetNextRecord ( xbInt16 iOption );
virtual xbInt16 GetNextRecord ( xbInt16 iOption, xbUInt32 ulStartRec );
- virtual xbInt32 GetPhysicalIxCnt () const;
virtual xbInt16 GetPrevRecord ();
virtual xbInt16 GetPrevRecord ( xbInt16 iOption );
virtual xbInt16 GetRecord ( xbUInt32 ulRecNo );
+
+ virtual xbUInt32 GetRecordCount ();
virtual xbInt16 GetRecordCnt ( xbUInt32 & ulRecCnt );
+
virtual char * GetRecordBuf ( xbInt16 iOpt = 0 ) const;
virtual xbUInt16 GetRecordLen () const;
virtual const xbString &GetTblAlias() const;
virtual xbInt16 GetVersion () const = 0;
virtual xbXBase *GetXbasePtr () const; // return xbase pointer
+
virtual xbBool MemoFieldsExist () const;
virtual xbInt16 Open ( const xbString &sTableName );
@@ -203,6 +206,7 @@ class XBDLLEXPORT xbDbf : public xbFile {
virtual xbInt16 PutRecord ( xbUInt32 ulRecNo );
virtual xbInt16 ReadHeader ( xbInt16 iFilePositionOption, xbInt16 iReadOption );
virtual xbInt16 RecordDeleted ( xbInt16 iOpt = 0 ) const;
+ virtual xbInt16 Rename ( const xbString sNewName ) = 0;
virtual xbInt16 SetAutoCommit ( xbInt16 iAutoCommit );
@@ -316,6 +320,7 @@ class XBDLLEXPORT xbDbf : public xbFile {
#ifdef XB_INDEX_SUPPORT
+ virtual xbInt16 CheckTagIntegrity( xbInt16 iTagOpt, xbInt16 iOutputOpt );
virtual xbInt16 CloseIndexFile( xbIx *pIx );
virtual xbInt16 CreateTag( const xbString &sIxType, const xbString &sName, const xbString &sKey, const xbString &sFilter,
xbInt16 iDescending, xbInt16 iUnique, xbInt16 iOverLay, xbIx **xbIxOut, void **vpTagOut );
@@ -326,30 +331,29 @@ class XBDLLEXPORT xbDbf : public xbFile {
virtual xbInt16 Find( xbDouble &dKey );
virtual xbIx *GetCurIx() const;
virtual void *GetCurTag() const;
-
+
virtual xbInt16 GetFirstKey();
virtual xbInt16 GetNextKey();
virtual xbInt16 GetPrevKey();
virtual xbInt16 GetLastKey();
-
+
virtual const xbString &GetCurIxType() const;
virtual const xbString &GetCurTagName() const;
virtual xbIxList *GetIxList() const;
+ virtual xbInt32 GetPhysicalIxCnt () const;
xbLinkListNode<xbTag *> *GetTagList () const;
+
virtual xbInt16 OpenIndex( const xbString &sIxType, const xbString &sIndexName );
+ virtual xbInt16 Reindex( xbInt16 iTagOpt );
virtual xbInt16 SetCurTag( const xbString &sTagName );
virtual void SetCurTag( const xbString &sIxType, xbIx *pIx, void *vpTag );
- #ifdef XB_DEBUG_SUPPORT
- virtual xbInt16 CheckTagIntegrity( xbInt16 iTagOpt, xbInt16 iOutputOpt );
- virtual xbInt16 Reindex( xbInt16 iTagOpt );
- #endif // XB_DEBUG_SUPPORT
#endif // XB_INDEX_SUPPORT
- #ifdef XB_NDXINF_SUPPORT
+ #ifdef XB_INF_SUPPORT
virtual xbInt16 AssociateIndex( const xbString &sType, const xbString &sName, xbInt16 iOption );
- xbLinkListNode<xbString> *GetNdxInfList() const;
- #endif // XB_NDXINF_SUPPORT
+ xbLinkListNode<xbString> *GetInfList() const;
+ #endif // XB_INF_SUPPORT
//#ifdef XB_MDX_SUPPORT
//virtual xbInt16 GetCreateMdxBlockSize() const;
@@ -365,12 +369,14 @@ class XBDLLEXPORT xbDbf : public xbFile {
xbInt16 AddIndex( xbIx *ix, const xbString &sFmt );
void ClearTagList();
- virtual xbInt16 GetNdxInfFileName( xbString &sNdxIdxFileName );
xbInt16 RemoveIndex( xbIx * ix );
void UpdateSchemaIxFlag( xbInt16 iFldNo, unsigned char cVal );
virtual xbInt16 UpdateTagList ();
- #endif
+ #endif // XB_INDEX_SUPPORT
+ #ifdef XB_INF_SUPPORT
+ virtual xbInt16 GetInfFileName( xbString &sNdxIdxFileName );
+ #endif // XB_INF_SUPPORT
#ifdef XB_LOCKING_SUPPORT
@@ -384,11 +390,11 @@ class XBDLLEXPORT xbDbf : public xbFile {
xbUInt32 ulCreateMemoBlockSize; // blocksize to use when creating dbt file
#endif
- #ifdef XB_NDXINF_SUPPORT
- virtual xbInt16 DeleteNdxInfData();
- virtual xbInt16 LoadNdxInfData();
- virtual xbInt16 SaveNdxInfData();
- #endif // XB_NDXINF_SUPPORT
+ #ifdef XB_INF_SUPPORT
+ virtual xbInt16 DeleteInfData();
+ virtual xbInt16 LoadInfData();
+ virtual xbInt16 SaveInfData();
+ #endif // XB_INF_SUPPORT
/*
#ifdef XB_MDX_SUPPORT
@@ -454,9 +460,6 @@ class XBDLLEXPORT xbDbf : public xbFile {
#ifdef XB_INDEX_SUPPORT
xbIxList *ixList; // pointer to a list of indices associated with the table
-// #ifdef XB_MDX_SUPPORT
-// xbIx *ixMdx; // pointer to production multi-tag index file
-// #endif
xbIx *pCurIx; // Pointer to current index class
void *vpCurIxTag; // Pointer to current tag
xbString sCurIxType; // Current index type
@@ -464,9 +467,9 @@ class XBDLLEXPORT xbDbf : public xbFile {
#endif // XB_INDEX_SUPPORT
-#ifdef XB_NDXINF_SUPPORT
- xbLinkList<xbString> llNdxInfData; // linked list of strings containing ndx file entries
-#endif // XB_NDXINF_SUPPORT
+#ifdef XB_INF_SUPPORT
+ xbLinkList<xbString> llInfData; // linked list of strings containing ndx file entries
+#endif // XB_INF_SUPPORT
};
@@ -487,6 +490,7 @@ class XBDLLEXPORT xbDbf3 : public xbDbf {
virtual xbInt16 CreateTable ( const xbString &sTableName, const xbString &sAlias, xbSchema *, xbInt16 iOverlay, xbInt16 iShareMode );
virtual xbInt16 GetVersion () const;
virtual xbInt16 Open ( const xbString &sTableName, const xbString &sAlias, xbInt16 iOpenMode, xbInt16 iShareMode );
+ virtual xbInt16 Rename ( const xbString sNewName );
#ifdef XB_MEMO_SUPPORT
virtual xbInt16 SetCreateMemoBlockSize( xbUInt32 iBlockSize );
@@ -518,6 +522,7 @@ class XBDLLEXPORT xbDbf4 : public xbDbf {
virtual xbInt16 CreateTable ( const xbString &sTableName, const xbString &sAlias, xbSchema *, xbInt16 iOverlay, xbInt16 iShareMode );
virtual xbInt16 GetVersion () const;
virtual xbInt16 Open ( const xbString &sTableName, const xbString &sAlias, xbInt16 iOpenMode, xbInt16 iShareMode );
+ virtual xbInt16 Rename ( const xbString sNewName );
#ifdef XB_MEMO_SUPPORT
virtual xbInt16 SetCreateMemoBlockSize( xbUInt32 iBlockSize );
diff --git a/src/include/xbfile.h b/src/include/xbfile.h
index a636632..ffbda06 100755
--- a/src/include/xbfile.h
+++ b/src/include/xbfile.h
@@ -151,7 +151,6 @@ class XBDLLEXPORT xbFile : public xbSsv {
xbInt16 xbRemove ();
xbInt16 xbRename ( const xbString &sOldName, const xbString &sNewName );
- xbInt16 xbRename ( const xbString &sOldName, const xbString &sNewName, xbInt16 iOption );
void xbRewind ();
xbInt16 xbTruncate ( xbInt64 llSize );
diff --git a/src/include/xbmemo.h b/src/include/xbmemo.h
index e86a65c..ad9aac2 100755
--- a/src/include/xbmemo.h
+++ b/src/include/xbmemo.h
@@ -59,30 +59,32 @@ class XBDLLEXPORT xbMemo : public xbFile {
/* virtual methods */
virtual ~xbMemo();
- virtual xbInt16 Abort () = 0;
- virtual xbInt16 CloseMemoFile ();
- virtual xbInt16 Commit () = 0;
+ virtual xbInt16 Abort () = 0;
+ virtual xbInt16 CloseMemoFile ();
+ virtual xbInt16 Commit () = 0;
+ virtual xbInt16 CreateMemoFile () = 0;
+
+ virtual xbInt16 DumpMemoHeader () = 0;
- #ifdef XB_LOCKING_SUPPORT
- virtual xbInt16 LockMemo ( xbInt16 iLockFunction );
- virtual xbBool GetMemoLocked () const;
- #endif
- /* pure virtual methods */
- virtual xbInt16 CreateMemoFile () = 0;
-
- virtual xbInt16 GetMemoField ( xbInt16 iFieldNo, xbString &sMemoData ) = 0;
- virtual xbInt16 GetMemoFieldLen( xbInt16 iFieldNo, xbUInt32 &ulMemoFieldLen ) = 0;
- virtual xbInt16 OpenMemoFile () = 0;
- virtual xbInt16 GetMemoFileType();
- virtual xbInt16 PackMemo ( void (*memoStatusFunc)(xbUInt32 ulItemNum, xbUInt32 ulNumItems)) = 0;
- virtual xbInt16 UpdateMemoField( xbInt16 iFieldNo, const xbString &sMemoData ) = 0;
+ virtual xbInt16 GetMemoField ( xbInt16 iFieldNo, xbString &sMemoData ) = 0;
+ virtual xbInt16 GetMemoFieldLen ( xbInt16 iFieldNo, xbUInt32 &ulMemoFieldLen ) = 0;
+ virtual xbInt16 OpenMemoFile () = 0;
+ virtual xbInt16 GetMemoFileType ();
+ virtual xbInt16 PackMemo ( void (*memoStatusFunc)(xbUInt32 ulItemNum, xbUInt32 ulNumItems)) = 0;
+ virtual xbInt16 UpdateMemoField ( xbInt16 iFieldNo, const xbString &sMemoData ) = 0;
#ifdef XB_DEBUG_SUPPORT
virtual xbInt16 DumpMemoFreeChain() = 0;
- virtual xbInt16 DumpMemoHeader () = 0;
#endif
+ #ifdef XB_LOCKING_SUPPORT
+ virtual xbInt16 LockMemo ( xbInt16 iLockFunction );
+ virtual xbBool GetMemoLocked () const;
+ #endif
+
+
+
// *********** FIXME *************
// next two methods should be protected but are called in the xb_test_xxxx programs testing routines
// so for now, they are kept as public
@@ -135,6 +137,7 @@ class XBDLLEXPORT xbMemoDbt3 : public xbMemo {
virtual xbInt16 Abort ();
virtual xbInt16 Commit ();
virtual xbInt16 CreateMemoFile ();
+ virtual xbInt16 DumpMemoHeader ();
virtual xbInt16 GetMemoField ( xbInt16 iFieldNo, xbString &sMemoData );
virtual xbInt16 GetMemoFieldLen( xbInt16 iFieldNo, xbUInt32 &ulMemoFieldLen );
virtual xbInt16 OpenMemoFile ();
@@ -143,7 +146,6 @@ class XBDLLEXPORT xbMemoDbt3 : public xbMemo {
#ifdef XB_DEBUG_SUPPORT
virtual xbInt16 DumpMemoFreeChain();
- virtual xbInt16 DumpMemoHeader ();
#endif
protected:
@@ -176,7 +178,7 @@ class XBDLLEXPORT xbMemoDbt4 : public xbMemo {
virtual xbInt16 Abort ();
virtual xbInt16 Commit ();
virtual xbInt16 CreateMemoFile ();
-
+ virtual xbInt16 DumpMemoHeader ();
virtual xbInt16 GetMemoField ( xbInt16 iFieldNo, xbString &sMemoData );
virtual xbInt16 GetMemoFieldLen ( xbInt16 iFieldNo, xbUInt32 &ulMemoFieldLen );
virtual xbInt16 GetMemoFieldLen ( xbInt16 iFieldNo, xbUInt32 &ulMemoFieldLen, xbUInt32 &lBlockNo );
@@ -186,7 +188,6 @@ class XBDLLEXPORT xbMemoDbt4 : public xbMemo {
#ifdef XB_DEBUG_SUPPORT
virtual xbInt16 DumpMemoFreeChain ();
- virtual xbInt16 DumpMemoHeader ();
virtual xbInt16 DumpMemoInternals ();
virtual xbInt16 ReadFreeBlockHeader( xbUInt32 ulBlockNo, xbUInt32 &ulNextBlock, xbUInt32 &ulFreeBlockCnt );
#endif
diff --git a/src/include/xbsql.h b/src/include/xbsql.h
index 3869995..653096c 100755
--- a/src/include/xbsql.h
+++ b/src/include/xbsql.h
@@ -29,6 +29,19 @@ This class manages a list of open tables, open indices are connected to the open
namespace xb{
+struct XBDLLEXPORT xbSqlFld{
+ char cType; // F - Database field
+ // L - Literal
+ // E - Expression
+ xbInt16 iFldNo; // Field number if db field
+ xbExp * pExp; // If cType=E, pointer to parsed expression
+ xbString sFldAlias; // Alias name for query display
+ xbSqlFld * Next; // Next field in list
+};
+
+
+
+
class XBDLLEXPORT xbSql : public xbSsv {
public:
// xbSql();
@@ -42,18 +55,21 @@ class XBDLLEXPORT xbSql : public xbSsv {
private:
+ xbInt16 SqlAlterTable( const xbString &sCmdLine );
xbInt16 SqlCreateTable( const xbString &sCmdLine );
- xbInt16 SqlCreateIndex( const xbString &sCmdLine );
-
- xbInt16 SqlDropIndex( const xbString &sCmdLine );
+ xbInt16 SqlDelete( const xbString &sCmdLine );
xbInt16 SqlDropTable( const xbString &sCmdLine );
+ #ifdef XB_INDEX_SUPPORT
+ xbInt16 SqlCreateIndex( const xbString &sCmdLine );
+ xbInt16 SqlDropIndex( const xbString &sCmdLine );
+ #endif // XB_INDEX_SUPPORT
// xbInt16 SqlCreateView( const xbString &sCmdLine );
// xbInt16 SqlDropView( const xbString &sCmdLine );
// xbInt16 SqlUpdate( const xbString &sCmdLine );
-// xbInt16 SqlSelect( const xbString &sCmdLine );
-
+ xbInt16 SqlSelect( const xbString &sCmdLine );
+
void SqlHelp() const;
xbInt16 SqlInsert( const xbString &sCmLine );
xbInt16 SqlSet( const xbString &sCmdLine );
diff --git a/src/include/xbssv.h b/src/include/xbssv.h
index 80da2d0..b9345fd 100755
--- a/src/include/xbssv.h
+++ b/src/include/xbssv.h
@@ -70,12 +70,9 @@ class XBDLLEXPORT xbSsv{
void SetDataDirectory ( const xbString &sDataDirectory );
void SetDefaultDateFormat ( const xbString &sDefaultDateFormat );
-
xbBool BitSet ( unsigned char c, xbInt16 iBitNo ) const;
- #ifdef XB_DEBUG_SUPPORT
void BitDump ( unsigned char c ) const;
void BitDump ( char c ) const;
- #endif
xbBool GetDefaultAutoCommit () const;
void SetDefaultAutoCommit ( xbBool bDefaultAutoCommit );
diff --git a/src/include/xbstring.h b/src/include/xbstring.h
index c2f15cd..f5a22da 100755
--- a/src/include/xbstring.h
+++ b/src/include/xbstring.h
@@ -95,8 +95,8 @@ class XBDLLEXPORT xbString {
xbString &Append(char c);
xbString &Assign(const char *srcStr, xbUInt32 lStartPos, xbUInt32 lCopyLen );
xbString &Assign(const char *srcStr, xbUInt32 lStartPos );
- xbString &Assign(const xbString &s, xbUInt32 pos, xbUInt32 n );
- xbString &Assign(const xbString &s, xbUInt32 n );
+ xbString &Assign(const xbString &s, xbUInt32 pos, xbUInt32 lCopyLen );
+ xbString &Assign(const xbString &s, xbUInt32 lCopyLen );
xbString Copy() const;
xbUInt32 CountChar( char c ) const;
@@ -136,6 +136,7 @@ class XBDLLEXPORT xbString {
xbString &PutAt(xbUInt32 ulPos, char c);
xbString &Remove( xbUInt32 ulPos, xbUInt32 ulN );
+ xbString &Replace( const char *sReplace, const char *sReplaceWith, xbInt16 iOpt = 0 );
xbString &Resize( xbUInt32 lSize );
xbString &Rtrim();
diff --git a/src/include/xbtblmgr.h b/src/include/xbtblmgr.h
index d551002..150026b 100755
--- a/src/include/xbtblmgr.h
+++ b/src/include/xbtblmgr.h
@@ -39,14 +39,15 @@ class XBDLLEXPORT xbTblMgr : public xbSsv {
public:
xbTblMgr();
~xbTblMgr();
- xbInt16 AddTblToTblList ( xbDbf *d, const xbString &sTblName );
- xbInt16 AddTblToTblList ( xbDbf *d, const xbString &sTblName, const xbString &sTblAlias );
- xbInt16 DisplayTableList () const;
- xbDbf * GetDbfPtr ( const xbString &sTblAlias ) const;
- xbDbf * GetDbfPtr ( xbInt16 sItemNo ) const;
- xbInt16 GetOpenTableCount () const;
- xbInt16 RemoveTblFromTblList ( const xbString &sTblAlias );
- xbInt16 RemoveTblFromTblList ( xbDbf *d );
+ xbInt16 AddTblToTblList ( xbDbf *d, const xbString &sTblName );
+ xbInt16 AddTblToTblList ( xbDbf *d, const xbString &sTblName, 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: