Xbase64 4.0.1
C++ Library for handling Xbase (DBF) format type files
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
xb::xbDbf Class Referenceabstract

Base class for handling dbf files/tables. More...

#include <xbdbf.h>

Inheritance diagram for xb::xbDbf:
xb::xbFile xb::xbSsv

Public Member Functions

 xbDbf (xbXBase *x)
 Constructor. More...
 
virtual ~xbDbf ()
 Destructor. More...
 
virtual xbInt16 Abort ()
 Abort any uncommited changes for the current record buffer. More...
 
virtual xbInt16 AppendRecord ()
 Append the current record to the data file. More...
 
virtual xbInt16 BlankRecord ()
 Blank the record buffer. More...
 
virtual xbInt16 Commit ()
 Commit updates to disk. More...
 
virtual xbInt16 Close ()
 Close DBF file/table. More...
 
virtual xbInt16 CopyDbfStructure (xbDbf *dNewTable, const xbString &sTableName, const xbString &sTableAlias, xbInt16 iOverlay, xbInt16 iShareMode)
 Copy table (dbf) file structure. More...
 
virtual xbInt16 CreateTable (const xbString &sTableName, const xbString &sAlias, xbSchema *pSchema, xbInt16 iOverlay, xbInt16 iShareMode)=0
 
virtual xbInt16 DeleteTable ()
 Delete a table. More...
 
virtual xbInt16 DeleteAll (xbInt16 iOption)
 Delete or undelete all records in a dbf file (table). More...
 
virtual xbInt16 DeleteAllRecords ()
 Delete all records. More...
 
virtual xbInt16 DeleteRecord ()
 Delete the current record. More...
 
virtual xbInt16 DumpHeader (xbInt16 iOption)
 Dump dbf file header. More...
 
virtual xbInt16 DumpRecord (xbUInt32 ulRecNo, xbInt16 iOutputDest=0, xbInt16 iOutputFmt=0)
 Dump record. More...
 
virtual xbInt16 GetAutoCommit () const
 Get auto commit setting. More...
 
virtual xbInt16 GetAutoCommit (xbInt16 iOption) const
 Get auto commit setting. More...
 
virtual xbBool GetBof ()
 Get a pointer to the current index object. More...
 
virtual xbUInt32 GetCurRecNo () const
 Return the current record number. More...
 
virtual xbInt16 GetDbfStatus () const
 Return the current dbf status. More...
 
virtual xbBool GetEof ()
 Return true if dbf file empty or positioned to the last record. More...
 
virtual xbInt32 GetFieldCnt () const
 Return the number of fields in the table. More...
 
virtual xbInt16 GetFirstRecord ()
 Get the first record. More...
 
virtual xbInt16 GetFirstRecord (xbInt16 iOption)
 Get the first record. More...
 
virtual xbUInt16 GetHeaderLen () const
 
virtual xbInt16 GetLastRecord ()
 Get the last record. More...
 
virtual xbInt16 GetLastRecord (xbInt16 iOption)
 Get the last record. More...
 
virtual xbInt16 GetNextRecord ()
 Get the next record. More...
 
virtual xbInt16 GetNextRecord (xbInt16 iOption)
 Get the next record. More...
 
virtual xbInt16 GetNextRecord (xbInt16 iOption, xbUInt32 ulStartRec)
 Get the next record. More...
 
virtual xbInt16 GetPrevRecord ()
 Get the previous record. More...
 
virtual xbInt16 GetPrevRecord (xbInt16 iOption)
 Get the previous record. More...
 
virtual xbInt16 GetRecord (xbUInt32 ulRecNo)
 Get record for specified record number. More...
 
virtual xbInt16 GetRecordCnt (xbUInt32 &ulRecCnt)
 Get the current number of records in the dbf data file. More...
 
virtual char * GetRecordBuf (xbInt16 iOpt=0) const
 Get pointer to record buffer. More...
 
virtual xbUInt16 GetRecordLen () const
 Get the dbf record length. More...
 
virtual const xbStringGetTblAlias () const
 Get the table alias. More...
 
virtual xbInt16 GetVersion () const =0
 
virtual xbXBaseGetXbasePtr () const
 Get the pointer to the xbXbase structure,. More...
 
virtual xbBool MemoFieldsExist () const
 Check for existence of any memo fields. More...
 
virtual xbInt16 Open (const xbString &sTableName)
 Open a table/dbf file. More...
 
virtual xbInt16 Open (const xbString &sTableName, const xbString &sAlias)
 Open a table/dbf file. More...
 
virtual xbInt16 Open (const xbString &sTableName, const xbString &sAlias, xbInt16 iOpenMode, xbInt16 iShareMode)=0
 
virtual xbInt16 Pack ()
 Pack dbf file. More...
 
virtual xbInt16 Pack (xbUInt32 &ulDeletedRecCnt)
 Pack dbf file. More...
 
virtual xbInt16 PutRecord ()
 Write the current record to disk. More...
 
virtual xbInt16 PutRecord (xbUInt32 ulRecNo)
 Write record to disk. More...
 
virtual xbInt16 RecordDeleted (xbInt16 iOpt=0) const
 Return record deletion status. More...
 
virtual xbInt16 Rename (const xbString sNewName)=0
 
virtual xbInt16 SetAutoCommit (xbInt16 iAutoCommit)
 Set auto commit. More...
 
virtual xbInt16 UndeleteAllRecords ()
 Set auto lock. More...
 
virtual xbInt16 UndeleteRecord ()
 Undelete one record. More...
 
virtual xbInt16 Zap ()
 Zap (remove) everything from the file,. More...
 
virtual xbInt16 GetField (xbInt16 iFieldNo, xbString &sFieldValue, xbInt16 iRecBufSw) const
 Get field data for field number. More...
 
virtual xbInt16 GetField (xbInt16 iFieldNo, xbString &sFieldValue) const
 Get field data for field number. More...
 
virtual xbInt16 GetField (const xbString &sFieldName, xbString &sFieldValue) const
 Get xbString field for field name. More...
 
virtual xbInt16 GetFieldDecimal (xbInt16 iFieldNo, xbInt16 &iFieldDecimal) const
 Get decimal for field number. More...
 
virtual xbInt16 GetFieldDecimal (const xbString &sFieldName, xbInt16 &iFieldDecimal) const
 Get decimal for field name. More...
 
virtual xbInt16 GetFieldLen (xbInt16 iFieldNo, xbInt16 &iFieldLen) const
 Get field length for field number. More...
 
virtual xbInt16 GetFieldLen (const xbString &sFieldName, xbInt16 &iFieldLen) const
 Get field length for field name. More...
 
virtual xbInt16 GetFieldName (xbInt16 iFieldNo, xbString &sFieldName) const
 Returns the name of the specified field. More...
 
virtual xbInt16 GetFieldNo (const xbString &sFieldName, xbInt16 &iFieldNo) const
 Get the field number for name. More...
 
virtual xbInt16 GetFieldNo (const xbString &sFieldName) const
 Get field ID number for a given field name. More...
 
virtual xbInt16 GetFieldType (xbInt16 iFieldNo, char &cFieldType) const
 Get field type for field number. More...
 
virtual xbInt16 GetFieldType (const xbString &sFieldName, char &cFieldType) const
 Get field type for field name. More...
 
virtual xbInt16 PutField (const xbString &sFieldName, const xbString &sFieldData)
 Put field for field name. More...
 
virtual xbInt16 PutField (xbInt16 iFieldNo, const xbString &sFieldData)
 Put field for field number. More...
 
virtual xbInt16 PutLogicalField (xbInt16 iFieldNo, const xbString &sFieldData)
 Put logical field for field number. More...
 
virtual xbInt16 PutLogicalField (const xbString &sFieldName, const xbString &sFieldData)
 Put logical field for field name. More...
 
virtual xbInt16 GetLogicalField (xbInt16 iFieldNo, xbString &sFieldData) const
 Get logical field for field number. More...
 
virtual xbInt16 GetLogicalField (const xbString &sFieldName, xbString &sFieldData) const
 Get logical field for field name. More...
 
virtual xbInt16 PutLogicalField (xbInt16 iFieldNo, xbBool bFieldData)
 Put logical field for field number. More...
 
virtual xbInt16 PutLogicalField (const xbString &sFieldName, xbBool bFieldData)
 Put logical field for field name. More...
 
virtual xbInt16 GetLogicalField (xbInt16 iFieldNo, xbBool &bFieldData) const
 Get logical field for field number. More...
 
virtual xbInt16 GetLogicalField (xbInt16 iFieldNo, xbBool &bFieldData, xbInt16 iRecBufSw) const
 Get logical field for field number. More...
 
virtual xbInt16 GetLogicalField (const xbString &sFieldName, xbBool &bFieldData) const
 Get logical field for field name. More...
 
virtual xbInt16 GetLongField (xbInt16 iFieldNo, xbInt32 &lFieldValue) const
 Get long field for field number. More...
 
virtual xbInt16 GetLongField (const xbString &sFieldName, xbInt32 &lFieldValue) const
 Get long field for field name. More...
 
virtual xbInt16 PutLongField (xbInt16 iFieldNo, xbInt32 lFieldValue)
 Put long field for field number. More...
 
virtual xbInt16 PutLongField (const xbString &sFieldName, xbInt32 lFieldValue)
 Put long field for field name. More...
 
virtual xbInt16 GetULongField (xbInt16 iFieldNo, xbUInt32 &lFieldValue) const
 Get unsigned long field for field number. More...
 
virtual xbInt16 GetULongField (const xbString &sFieldName, xbUInt32 &lFieldValue) const
 Get unsigned long field for field name. More...
 
virtual xbInt16 PutULongField (xbInt16 iFieldNo, xbUInt32 lFieldValue)
 Put unsigned long field for field number. More...
 
virtual xbInt16 PutULongField (const xbString &sFieldNo, xbUInt32 lFieldValue)
 Put unsigned long field for field name. More...
 
virtual xbInt16 GetDoubleField (xbInt16 FieldNo, xbDouble &dFieldValue) const
 Get xbDouble field for field number. More...
 
virtual xbInt16 GetDoubleField (xbInt16 FieldNo, xbDouble &dFieldValue, xbInt16 iRecBufSw) const
 Get xbDouble field for field number. More...
 
virtual xbInt16 GetDoubleField (const xbString &sFieldName, xbDouble &dFieldValue) const
 Get xbDouble field for field name. More...
 
virtual xbInt16 PutDoubleField (xbInt16 FieldNo, xbDouble dFieldValue)
 Put double field for field number. More...
 
virtual xbInt16 PutDoubleField (const xbString &FieldName, xbDouble dFieldValue)
 Put double field for field name. More...
 
virtual xbInt16 GetFloatField (xbInt16 iFieldNo, xbFloat &fFieldValue) const
 Get xbFloat field for field number. More...
 
virtual xbInt16 GetFloatField (const xbString &sFieldName, xbFloat &fFieldValue) const
 Get xbFloat field for field name. More...
 
virtual xbInt16 PutFloatField (xbInt16 iFieldNo, xbFloat fFieldValue)
 Put float field for field number. More...
 
virtual xbInt16 PutFloatField (const xbString &sFieldName, xbFloat fFieldValue)
 Put float field for field name. More...
 
virtual xbInt16 GetDateField (xbInt16 iFieldNo, xbDate &dt) const
 Get xbDate field for field number. More...
 
virtual xbInt16 GetDateField (const xbString &sFieldName, xbDate &dt) const
 Get xbDate field for field name. More...
 
virtual xbInt16 PutDateField (xbInt16 iFieldNo, const xbDate &dt)
 Put date field for field number. More...
 
virtual xbInt16 PutDateField (const xbString &sFieldName, const xbDate &dt)
 Put date field for field name. More...
 
virtual xbInt16 GetNullSts (xbInt16 iFieldNo, xbBool &bIsNull) const
 Get field null status. More...
 
virtual xbInt16 GetNullSts (const xbString &sFieldName, xbBool &bIsNull) const
 Get field null status. More...
 
virtual xbInt16 GetNullSts (xbInt16 iFieldNo, xbBool &bIsNull, xbInt16 iRecBufSw) const
 Get field null status. More...
 
const xbStringGetDirectory () const
 Get the directory name. More...
 
const xbStringGetFileName () const
 Get the file name. More...
 
const xbStringGetFqFileName () const
 Get the fully qualified file name. More...
 
xbInt16 CreateUniqueFileName (const xbString &sDirIn, const xbString &sExtIn, xbString &sFqnOut, xbInt16 iOption=0)
 Create a unique file name. More...
 
xbInt16 DetermineXbaseTableVersion (unsigned char cFileTypeByte) const
 Determine xbase dbf version. More...
 
xbInt16 DetermineXbaseMemoVersion (unsigned char cFileTypeByte) const
 Determine which version the memo (dbt) file is. More...
 
xbDouble eGetDouble (const char *p) const
 Get a portable double value. More...
 
xbInt32 eGetInt32 (const char *p) const
 Get a portable long value. More...
 
xbUInt32 eGetUInt32 (const char *p) const
 Get a portable unsigned long value. More...
 
xbInt16 eGetInt16 (const char *p) const
 Get a portable short value. More...
 
xbUInt16 eGetUInt16 (const char *p) const
 Get a portable unsigned short value. More...
 
void ePutDouble (char *p, xbDouble d)
 Write a portable double value to memory location. More...
 
void ePutInt32 (char *p, xbInt32 l)
 Write a portable long value to memory location. More...
 
void ePutUInt32 (char *p, xbUInt32 ul)
 Write a portable unsigned long value to memory location. More...
 
void ePutInt16 (char *p, xbInt16 s)
 Write a portable short value to memory location. More...
 
void ePutUInt16 (char *p, xbUInt16 s)
 Write a portable unsigned short value to memory location. More...
 
xbBool FileExists () const
 Determines if a file exists. More...
 
xbBool FileExists (xbInt16 iOption) const
 Determines if a file exists. More...
 
xbBool FileExists (const xbString &sFileName) const
 Determines if a file exists. More...
 
xbBool FileExists (const xbString &sFileName, xbInt16 iOption) const
 Determines if a file exists. More...
 
xbBool FileIsOpen () const
 Determines if file is open. More...
 
xbUInt32 GetBlockSize () const
 Get the block size. More...
 
xbInt16 GetFileDirPart (xbString &sFileDirPartOut) const
 Get the directory part of the file name. More...
 
xbInt16 GetFileDirPart (const xbString &sCompleteFileNameIn, xbString &sFileDirPartOut) const
 Get the directory part of the file name. More...
 
xbInt16 GetFileExtPart (xbString &sFileExtPartOut) const
 Get the extension part of the file name. More...
 
xbInt16 GetFileExtPart (const xbString &sCompleteFileNameIn, xbString &sFileExtPartOut) const
 Get the extension part of the file name. More...
 
xbInt16 GetFileMtime (time_t &mtime)
 Get the time of last file modification timestamp as reported by the OS. More...
 
xbInt16 GetFileNamePart (xbString &sFileNamePartOut) const
 Get the name part of the file name. More...
 
xbInt16 GetFileNamePart (const xbString &sCompleteFileNameIn, xbString &sFileNamePartOut) const
 Get the name part of the file name. More...
 
xbInt16 GetFileSize (xbUInt64 &ullFileSize)
 Get the size of the file as reported by the OS. More...
 
xbInt16 GetFileType (xbString &sFileType) const
 Get the file type aka Capitalized file extension. More...
 
xbInt16 GetOpenMode () const
 Get the open mode of the file. More...
 
xbInt16 GetShareMode () const
 Get the share mode of the file. More...
 
xbInt16 GetXbaseFileTypeByte (const xbString &sFileName, xbInt16 &iVersion)
 Get the file type byte and version of the dbf file. More...
 
xbInt16 GetXbaseFileTypeByte (const xbString &sFileName, unsigned char &cFileTypeByte)
 Get the file type byte and version of the dbf file. More...
 
xbInt16 GetXbaseFileTypeByte (const xbString &sFileName, unsigned char &cFileTypeByte, xbInt16 &iVersion)
 Get the file type byte and version of the dbf file. More...
 
xbInt16 NameSuffixMissing (const xbString &sFileName, xbInt16 iOption) const
 Determines status of file extension. More...
 
xbInt16 ReadBlock (xbUInt32 ulBlockNo, size_t readSize, void *buf)
 Read a block of data from file. More...
 
xbInt16 ReadBlock (xbUInt32 ulBlockNo, xbUInt32 ulBlockSize, size_t readSize, void *buf)
 Read a block of data from file. More...
 
xbInt16 SetBlockSize (xbUInt32 ulBlockSize)
 Set the block size. More...
 
void SetDirectory (const xbString &sDirectory)
 Set the directory. More...
 
void SetFileName (const xbString &sFileName)
 Set the filename. More...
 
void SetFqFileName (const xbString &sFqName)
 Set the fully qualifed filename. More...
 
xbInt16 SetHomeFolders ()
 Set Home Folders. More...
 
xbInt16 WriteBlock (xbUInt32 ulBlockNo, size_t writeSize, void *buf)
 Write a block of data to file. More...
 
xbInt16 xbFclose ()
 Xbase wrapper for standard libary fclose. More...
 
xbInt16 xbFeof ()
 Xbase wrapper for standard libary feof. More...
 
xbInt16 xbFflush ()
 Xbase wrapper for standard libary fflush. More...
 
xbInt16 xbFgetc (xbInt32 &c)
 Xbase wrapper for standard libary fgetc. More...
 
xbInt16 xbFgetc (char &c)
 Xbase wrapper for standard libary fgetc. More...
 
xbInt16 xbFgets (size_t lSize, xbString &sLine)
 Xbase wrapper for standard libary fgets. More...
 
xbInt16 xbFopen (xbInt16 iOpenMode)
 
xbInt16 xbFopen (const xbString &sOpenMode, xbInt16 iShareMode)
 Xbase wrapper for standard libary fopen. More...
 
xbInt16 xbFopen (xbInt16 iOpenMode, xbInt16 iShareMode)
 Xbase wrapper for standard libary fopen. More...
 
xbInt16 xbFopen (const xbString &sMode, const xbString &sFileName, xbInt16 iShareMode)
 Xbase wrapper for standard libary fopen. More...
 
xbInt16 xbFputc (xbInt32 c)
 Xbase wrapper for standard libary fputc. More...
 
xbInt16 xbFputc (xbInt32 c, xbInt32 iNoTimes)
 Xbase wrapper for standard libary fputc. More...
 
xbInt16 xbFputs (const xbString &s)
 Xbase wrapper for standard libary fputs. More...
 
xbInt16 xbFread (void *ptr, size_t size, size_t nmemb)
 Xbase wrapper for standard libary fread. More...
 
xbInt16 xbFseek (xbInt64 llOffset, xbInt32 whence)
 Xbase wrapper for standard libary fseek. More...
 
size_t xbFtell ()
 Xbase wrapper for standard libary ftell. More...
 
void xbFTurnOffFileBuffering ()
 Turn off file buffering. More...
 
xbInt16 xbReadUntil (const char cDelim, xbString &sOut)
 Read file until a particular character is encountered on input stream. More...
 
xbInt16 xbRemove (const xbString &sFileName, xbInt16 iOption)
 Delete file. More...
 
xbInt16 xbRemove (const xbString &sFileName)
 Delete file. More...
 
xbInt16 xbRemove ()
 Delete file. More...
 
xbInt16 xbRename (const xbString &sOldName, const xbString &sNewName)
 Rename file. More...
 
void xbRewind ()
 Xbase wrapper for rewind. More...
 
xbInt16 xbFwrite (const void *ptr, size_t lSize, size_t lNmemb)
 Xbase wrapper for standard libary fwrite. More...
 
xbInt16 xbTruncate (xbInt64 llSize)
 Xbase wrapper for ftruncate. More...
 
void DisplayError (xbInt16 ErrorCode) const
 Display error message on console for a given error number. More...
 
xbStringGetDefaultDateFormat () const
 Get the default date format. More...
 
xbStringGetDataDirectory () const
 Get the current data directory. More...
 
xbStringGetTempDirectory () const
 Get the current temp directory. More...
 
void GetHomeDir (xbString &sHomeDirOut)
 Get home directory. More...
 
xbInt16 GetEndianType () const
 Get the Endian type. More...
 
const char * GetErrorMessage (xbInt16 ErrorCode) const
 Get an error message. More...
 
char GetPathSeparator () const
 Get the OS dependent path separator. More...
 
void SetDataDirectory (const xbString &sDataDirectory)
 Set the data directory. More...
 
void SetDefaultDateFormat (const xbString &sDefaultDateFormat)
 Set the default date format. More...
 
void SetTempDirectory (const xbString &sTempDirectory)
 Set the temp directory. More...
 
xbBool BitSet (unsigned char c, xbInt16 iBitNo) const
 Check a bit in a one byte field and see if it is set. More...
 
void BitDump (unsigned char c) const
 
void BitDump (char c) const
 
xbBool GetDefaultAutoCommit () const
 Get the default auto commit setting. More...
 
void SetDefaultAutoCommit (xbBool bDefaultAutoCommit)
 Set the default auto commit. More...
 
xbStringGetLogDirectory () const
 
xbStringGetLogFileName () const
 
void SetLogDirectory (const xbString &sLogDirectory)
 
void SetLogFileName (const xbString &sLogFileName)
 
xbBool GetMultiUser () const
 Get the multi user setting. More...
 
void SetMultiUser (xbBool bMultiUser)
 Get the multi user setting. More...
 

Static Public Attributes

static const char * ErrorCodeText []
 

Protected Member Functions

virtual xbInt16 ReadHeader (xbInt16 iFilePositionOption, xbInt16 iReadOption)
 Read dbf file header information. More...
 
virtual xbInt16 GetRawField (xbInt16 iFieldNo, char *Buf, xbUInt32 BufSize, xbInt16 iRecBufSw) const
 Get raw field data for field number. More...
 
virtual void InitVars ()
 
virtual xbInt16 SetVersion ()=0
 
virtual xbInt16 ValidateSchema (xbSchema *s)=0
 
xbInt16 WriteHeader (xbInt16 iPositionOption, xbInt16 iWriteOption)
 
void SetEndianType ()
 Set the endian type. More...
 

Protected Attributes

xbUInt32 ulCurRec
 
xbInt16 iAutoCommit
 
xbInt16 iFileVersion
 
xbString sAlias
 
xbInt16 iNoOfFields
 
xbInt16 iDbfStatus
 
xbSchemaRec * SchemaPtr
 
char * RecBuf
 
char * RecBuf2
 
unsigned char cVersion
 
char cUpdateYY
 
char cUpdateMM
 
char cUpdateDD
 
xbUInt32 ulNoOfRecs
 
xbUInt16 uiHeaderLen
 
xbUInt16 uiRecordLen
 
char cTransactionFlag
 
char cEncryptionFlag
 
char cIndexFlag
 
char cLangDriver
 
xbXBasexbase
 

Static Protected Attributes

static xbInt16 iEndianType = 0
 
static xbString sNullString = ""
 

Detailed Description

Base class for handling dbf files/tables.

The xbDbf class is used as a base class for accessing dbf files.
In line with relational theory, a each dbf file can be considered as a table. The documentation uses the terms dbf and table interchangeably.

This module handles methods for accessing and updating dbf files.


The class is designed to support additional file layouts with a minimal amount of effort. If you are wanting to update the library to support a new dbf file type not currently supported by the library, create a derived class using xbDbf as a base class and modify methods needed to support the new dbf file version.
See the following for examples on how to start on this:
xbDbf3 is a derived class from xbDbf and supports the original Dbase III+ file version.
xbDbf4 is a derived class from xbDbf and supports the original Dbase IV file version.

Constructor & Destructor Documentation

◆ xbDbf()

xb::xbDbf::xbDbf ( xbXBase x)

Constructor.

Parameters
xPointer to xbXbase

◆ ~xbDbf()

xb::xbDbf::~xbDbf ( )
virtual

Destructor.

Member Function Documentation

◆ Abort()

xbInt16 xb::xbDbf::Abort ( )
virtual

Abort any uncommited changes for the current record buffer.

Returns
Return Codes

◆ AppendRecord()

xbInt16 xb::xbDbf::AppendRecord ( )
virtual

Append the current record to the data file.

This method attempts to append the contents of the current record buffer to the end of the DBF file, updates the file date, number of records in the file and updates any open indices associated with this data file.

To add a record, an application would typically blank the record buffer, update various fields in the record buffer, then append the record.

The append method performs the following tasks:
1) Create new index key values
2) Lock the table
3) Lock append bytes
4) Lock indices
5) Read the dbf header
6) Check for dup keys
7) Calc last update date, no of recs
8) Add keys
9) Unlock indices
10) Update file header
11) Unlock file header
12) Append record
13) Unlock append bytes

Note: Locking memo files is not needed as the memo file updates are handled outside of the append method.

Returns
Return Codes

◆ BitDump() [1/2]

void xb::xbSsv::BitDump ( char  c) const
inherited

◆ BitDump() [2/2]

void xb::xbSsv::BitDump ( unsigned char  c) const
inherited

◆ BitSet()

xbBool xb::xbSsv::BitSet ( unsigned char  c,
xbInt16  iBitNo 
) const
inherited

Check a bit in a one byte field and see if it is set.

Parameters
cOne byte char field to examine.
iBitNowhich bit to examine.
Returns
xbTrue Bit is set
xbFalse Bit is not set

◆ BlankRecord()

xbInt16 xb::xbDbf::BlankRecord ( )
virtual

Blank the record buffer.

This method would typically be called to initialize the record buffer before updates are applied to append a new record.

Returns
Return Codes

◆ Close()

xbInt16 xb::xbDbf::Close ( )
virtual

Close DBF file/table.

This routine flushes any remaining updates to disk, closes the DBF file and any associated memo and index files.

Returns
Return Codes

◆ Commit()

xbInt16 xb::xbDbf::Commit ( )
virtual

Commit updates to disk.

This routine commits any pending updates to disk.

Returns
Return Codes

◆ CopyDbfStructure()

xbInt16 xb::xbDbf::CopyDbfStructure ( xbDbf dNewTable,
const xbString sNewTableName,
const xbString sNewTableAlias,
xbInt16  iOverlay,
xbInt16  iShareMode 
)
virtual

Copy table (dbf) file structure.

This routine will copy the structure of a dbf file and if successful return a pointer to the new table in an open state.

Parameters
dNewTableReference to new table object.
sNewTableNameNew table (dbf) name.
sNewTableAliasAlias name of new table.
iOverlayxbTrue - Overlay existing file.
xbFalse - Don't overlay existing file.
iShareModeXB_SINGLE_USER
XB_MULTI_USER
Returns
Return Codes Copy DBF structure

◆ CreateTable()

virtual xbInt16 xb::xbDbf::CreateTable ( const xbString sTableName,
const xbString sAlias,
xbSchema pSchema,
xbInt16  iOverlay,
xbInt16  iShareMode 
)
pure virtual

◆ CreateUniqueFileName()

xbInt16 xb::xbFile::CreateUniqueFileName ( const xbString sDirIn,
const xbString sExtIn,
xbString sFqnOut,
xbInt16  iOption = 0 
)
inherited

Create a unique file name.

Given a directory and file extension as inputs, create a unique file name.

Parameters
sDirInDirectory
sExtInFile Extension
sFqnOutA fully qualifed unique file name as output
Returns
Return Codes

Create a unique file name.

Given a directory and file extension as inputs, create a unique file name.

Parameters
sDirInDirectory
sExtInFile Extension
iOption0 - look only for one file for a given directory and extension
1 - if file name extension is "dbf" or "DBF", verify unique dbt or DBT (memo) file is also available
sFqnOutA fully qualifed unique file name as output
Returns
Return Codes

◆ DeleteAll()

xbInt16 xb::xbDbf::DeleteAll ( xbInt16  iOption)
virtual

Delete or undelete all records in a dbf file (table).

This routine deletes or un-deletes all records. The xbase file format contains a leading one byte character used for flagging a record as deleted. When a record is deleted, it's not physically removed from the file, the first byte is flagged as deleted.

Parameters
iOption0 - Delete all records.
1 - Un-delete all deleted records.
Returns
Return Codes

◆ DeleteAllRecords()

xbInt16 xb::xbDbf::DeleteAllRecords ( )
virtual

Delete all records.

This routine deletes all the records in a table / dbf file.

Returns
Return Codes

◆ DeleteRecord()

xbInt16 xb::xbDbf::DeleteRecord ( )
virtual

Delete the current record.

This routine flags the current record for deletion if it's not already flagged.

Returns
XB_NO_ERROR
XB_INVALID_RECORD

◆ DeleteTable()

xbInt16 xb::xbDbf::DeleteTable ( )
virtual

Delete a table.

This routine deletes a given table, associated index files if any, the memo file if any and the .INF file if any.

Returns
Return Codes

◆ DetermineXbaseMemoVersion()

xbInt16 xb::xbFile::DetermineXbaseMemoVersion ( unsigned char  cFileTypeByte) const
inherited

Determine which version the memo (dbt) file is.

This routine uses the first byte in the dbf file to determine which memo file version is in use. The main difference between version 3 and 4 is that version 4 will reuse blocks if they become available. Version 3 does not.

Parameters
cFileTypeByteis an output field and is one of:

0 - none
3 - Dbase III+
4 - Dbase IV
Returns
Return Codes

◆ DetermineXbaseTableVersion()

xbInt16 xb::xbFile::DetermineXbaseTableVersion ( unsigned char  cFileTypeByte) const
inherited

Determine xbase dbf version.

This routine is used to determine which version of the Xbase classes can be used for a given DBF file.

It attempts to use the highest version compiled into the library.

References:
This routine uses the first byte from the dbf file.
Per DBase documentation:
Valid dBASE for Windows table file, bits 0-2 indicate version number: 3 for dBASE Level 5, 4 for dBASE Level 7.
Bit 3 and bit 7 indicate presence of a dBASE IV or dBASE for Windows memo file;
Bits 4-6 indicate the presence of a dBASE IV SQL table;
Bit 7 indicates the presence of any .DBT memo file (either a dBASE III PLUS type or a dBASE IV or dBASE for Windows memo file).

Bachmann spec (used extensively in library build), page 7 - does not match DBase documentation

returns
0 - unknown
3 - Dbase level 3
4 - Dbase level 4
5 - Dbase Level 5 (future)
7 - Dbase Level 7 (future)

1x - Clipper files (future)
2x - Foxbase files (future)

◆ DisplayError()

void xb::xbSsv::DisplayError ( xbInt16  iErrorCode) const
inherited

Display error message on console for a given error number.

Parameters
iErrorCodeError number to reference

◆ DumpHeader()

xbInt16 xb::xbDbf::DumpHeader ( xbInt16  iOption)
virtual

Dump dbf file header.

This routine dumps dbf header information to the console.

Parameters
iOption1 = Print header only
2 = Field data only
3 = Header and Field data
4 = Header, Field and Memo header data if applicable
Returns
Return Codes

◆ DumpRecord()

xbInt16 xb::xbDbf::DumpRecord ( xbUInt32  ulRecNo,
xbInt16  iOutputDest = 0,
xbInt16  iOutputFmt = 0 
)
virtual

Dump record.

Dump the contents of the specified record

Parameters
ulRecNoRecord number of record to be dumped.
iOutputDest0 = stdout
1 = Syslog
2 = Both
iOutputFmt0 = with field names
1 = 1 line per rec, no field names
2 = 1 line per rec, first line is a list of field names.
Returns
Return Codes

◆ eGetDouble()

xbDouble xb::xbFile::eGetDouble ( const char *  p) const
inherited

Get a portable double value.

This routine returns a double value from an 8 byte character stream, accounting for endian type.

Converts a double (64 bit floating point) value stored at p from a portable format to the machine format.

Parameters
ppointer to memory containing the portable double value
Returns
the double value.

◆ eGetInt16()

xbInt16 xb::xbFile::eGetInt16 ( const char *  p) const
inherited

Get a portable short value.

This routine returns a short int value from a 2 byte character stream, accounting for endian type.

Parameters
ppointer to memory containing the portable long value
Returns
the short value.

◆ eGetInt32()

xbInt32 xb::xbFile::eGetInt32 ( const char *  p) const
inherited

Get a portable long value.

This routine returns a long int value from a 4 byte character stream, accounting for endian type.

Parameters
ppointer to memory containing the portable long value
Returns
the long value.

◆ eGetUInt16()

xbUInt16 xb::xbFile::eGetUInt16 ( const char *  p) const
inherited

Get a portable unsigned short value.

This routine returns a short unsigned int value from a 2 byte character stream, accounting for endian type.

Parameters
ppointer to memory containing the portable long value
Returns
the short value.

◆ eGetUInt32()

xbUInt32 xb::xbFile::eGetUInt32 ( const char *  p) const
inherited

Get a portable unsigned long value.

This routine returns an unsigned long int value from a 4 byte character stream, accounting for endian type.

Parameters
ppointer to memory containing the portable long value
Returns
the unsigned long value.

◆ ePutDouble()

void xb::xbFile::ePutDouble ( char *  c,
xbDouble  d 
)
inherited

Write a portable double value to memory location.

Converts a double (64 bit floating point) value from machine format to a portable format and stores the converted value in the memory referenced by c.

This routine puts a double value to an 8 byte character stream

Parameters
cPointer to memory to hold converted value
dInput value to be converted

◆ ePutInt16()

void xb::xbFile::ePutInt16 ( char *  c,
xbInt16  s 
)
inherited

Write a portable short value to memory location.

Converts a short (16 bit integer) value from machine format to a portable format and stores the converted value in the memory referenced by c.

This routine puts a short value to a 2 byte character stream

Parameters
cPointer to memory to hold converted value
sInput value to be converted

◆ ePutInt32()

void xb::xbFile::ePutInt32 ( char *  c,
xbInt32  l 
)
inherited

Write a portable long value to memory location.

Converts a long (32 bit integer) value from machine format to a portable format and stores the converted value in the memory referenced by c.

This routine puts a long value to a 4 byte character stream.

Parameters
cPointer to memory to hold converted value
lInput value to be converted

◆ ePutUInt16()

void xb::xbFile::ePutUInt16 ( char *  c,
xbUInt16  s 
)
inherited

Write a portable unsigned short value to memory location.

Converts an unsigned short (16 bit integer) value from machine format to a portable format and stores the converted value in the memory referenced by c.

This routine puts an unsigned short value to a 2 byte character stream

Parameters
cPointer to memory to hold converted value
sInput value to be converted

◆ ePutUInt32()

void xb::xbFile::ePutUInt32 ( char *  c,
xbUInt32  ul 
)
inherited

Write a portable unsigned long value to memory location.

Converts an unsigned long (32 bit integer) value from machine format to a portable format and stores the converted value in the memory referenced by c.

This routine puts an unsigned long value to a 4 byte character stream.

Parameters
cPointer to memory to hold converted value
ulInput value to be converted

◆ FileExists() [1/4]

xbBool xb::xbFile::FileExists ( ) const
inherited

Determines if a file exists.

Returns
xbTrue if file exists
xbFalse if file does not exist

◆ FileExists() [2/4]

xbBool xb::xbFile::FileExists ( const xbString sFileName) const
inherited

Determines if a file exists.

Parameters
sFileName- file name to check for
Returns
xbTrue if file exists
xbFalse if file does not exist

◆ FileExists() [3/4]

xbBool xb::xbFile::FileExists ( const xbString sFileName,
xbInt16  iOption 
) const
inherited

Determines if a file exists.

Parameters
sFileName- file name to check for
iOptionif 1, assume this is a request for a dbf file and check for the a dbt memo file also, returns true if both files are found
Returns
xbTrue if both dbf and dbt files exist
xbFalse if file does not exist

◆ FileExists() [4/4]

xbBool xb::xbFile::FileExists ( xbInt16  iOption) const
inherited

Determines if a file exists.

Parameters
iOptionif 1, assume this is a request for a dbf file and check for the a dbt memo file also, returns true if both files are found
Returns
xbTrue if both files exist
xbFalse if file does not exist

◆ FileIsOpen()

xbBool xb::xbFile::FileIsOpen ( ) const
inherited

Determines if file is open.

Returns
xbTrue if file is open
xbFalse if file is not open

◆ GetAutoCommit() [1/2]

xbInt16 xb::xbDbf::GetAutoCommit ( ) const
virtual

Get auto commit setting.

This routine returns the table setting if set, otherwise returns the system level setting.

Returns
Not 0 - Auto commit on for this table.
0 - Auto commit off for this table.

◆ GetAutoCommit() [2/2]

xbInt16 xb::xbDbf::GetAutoCommit ( xbInt16  iOption) const
virtual

Get auto commit setting.

Parameters
iOption0 - Specific setting for this table
1 - If this table should be auto updated (takes DBMS setting into account)
Returns
Not 0 - Auto commit on for this table.
0 - Auto commit off for this table.

◆ GetBlockSize()

xbUInt32 xb::xbFile::GetBlockSize ( ) const
inherited

Get the block size.

Returns
Block Size

◆ GetBof()

xbBool xb::xbDbf::GetBof ( )
virtual

Get a pointer to the current index object.

Returns
Pointer to current index.

Return true if dbf file empty or positioned to the first record

Returns
Returns true if dbf file is empty or positioned on the first record.

◆ GetCurRecNo()

xbUInt32 xb::xbDbf::GetCurRecNo ( ) const
virtual

Return the current record number.

Returns
Returns the current record number.

◆ GetDataDirectory()

xbString & xb::xbSsv::GetDataDirectory ( ) const
inherited

Get the current data directory.

Returns
xbString containing the current data directory where the database files are stored.

◆ GetDateField() [1/2]

xbInt16 xb::xbDbf::GetDateField ( const xbString sFieldName,
xbDate dtFieldValue 
) const
virtual

Get xbDate field for field name.

Parameters
sFieldNameName of field to retrieve.
dtFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetDateField() [2/2]

xbInt16 xb::xbDbf::GetDateField ( xbInt16  iFieldNo,
xbDate dtFieldValue 
) const
virtual

Get xbDate field for field number.

Parameters
iFieldNoNumber of field to retrieve.
dtFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetDbfStatus()

xbInt16 xb::xbDbf::GetDbfStatus ( ) const
virtual

Return the current dbf status.

Returns
0 = closed
1 = open
2 = updates pending

◆ GetDefaultAutoCommit()

xbBool xb::xbSsv::GetDefaultAutoCommit ( ) const
inherited

Get the default auto commit setting.

When auto commit is enabled, the library will automatically post any updates when moving off an updated record or closing files. If auto commit is disabled, the application program will need to explicitly update the tables using using dbf->Put() and dbf->AppendRecord().

Returns
xbTrue if auto commit is turned on
xbFalse is auto commit is turned off

◆ GetDefaultDateFormat()

xbString & xb::xbSsv::GetDefaultDateFormat ( ) const
inherited

Get the default date format.

Returns
xbString containing the default date format.

◆ GetDirectory()

const xbString & xb::xbFile::GetDirectory ( ) const
inherited

Get the directory name.

Returns
the directory name of the file

◆ GetDoubleField() [1/3]

xbInt16 xb::xbDbf::GetDoubleField ( const xbString sFieldName,
xbDouble dFieldValue 
) const
virtual

Get xbDouble field for field name.

Parameters
sFieldNameName of field to retrieve.
dFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetDoubleField() [2/3]

xbInt16 xb::xbDbf::GetDoubleField ( xbInt16  iFieldNo,
xbDouble dFieldValue 
) const
virtual

Get xbDouble field for field number.

Parameters
iFieldNoNumber of field to retrieve.
dFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetDoubleField() [3/3]

xbInt16 xb::xbDbf::GetDoubleField ( xbInt16  iFieldNo,
xbDouble dFieldValue,
xbInt16  iRecBufSw 
) const
virtual

Get xbDouble field for field number.

Parameters
iFieldNoNumber of field to retrieve.
dFieldValueOutput field value.
iRecBufSw0 - Record buffer with any updates.
1 - Record buffer with original data.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetEndianType()

xbInt16 xb::xbSsv::GetEndianType ( ) const
inherited

Get the Endian type.

Returns
B - Big endian
L - Little endian

◆ GetEof()

xbBool xb::xbDbf::GetEof ( )
virtual

Return true if dbf file empty or positioned to the last record.

Returns
Returns true if error, dbf file is empty or positioned on the last record.

◆ GetErrorMessage()

const char * xb::xbSsv::GetErrorMessage ( xbInt16  iErrorCode) const
inherited

Get an error message.

Parameters
iErrorCodeErrorCode is the error number of description to be returned.
Returns
Returns a pointer to a string containing a text description for the error code.

◆ GetField() [1/3]

xbInt16 xb::xbDbf::GetField ( const xbString sFieldName,
xbString sFieldValue 
) const
virtual

Get xbString field for field name.

Parameters
sFieldNameName of field to retrieve
sFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetField() [2/3]

xbInt16 xb::xbDbf::GetField ( xbInt16  iFieldNo,
xbString sFieldValue 
) const
virtual

Get field data for field number.

Parameters
iFieldNoNumber of field to retrieve.
sFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetField() [3/3]

xbInt16 xb::xbDbf::GetField ( xbInt16  iFieldNo,
xbString sFieldValue,
xbInt16  iRecBufSw 
) const
virtual

Get field data for field number.

Parameters
iFieldNoNumber of field to retrieve.
sFieldValueOutput field value.
iRecBufSw0 - Record buffer with any updates.
1 - Record buffer with original data.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetFieldCnt()

xbInt32 xb::xbDbf::GetFieldCnt ( ) const
virtual

Return the number of fields in the table.

Returns
The number of fields in the table.

◆ GetFieldDecimal() [1/2]

xbInt16 xb::xbDbf::GetFieldDecimal ( const xbString sFieldName,
xbInt16 &  iFieldDecimal 
) const
virtual

Get decimal for field name.

This routine retreives a field's decimal length.

Parameters
sFieldNameName of field to retrieve
iFieldDecimalOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetFieldDecimal() [2/2]

xbInt16 xb::xbDbf::GetFieldDecimal ( xbInt16  iFieldNo,
xbInt16 &  iFieldDecimal 
) const
virtual

Get decimal for field number.

This routine retreives a field's decimal length.

Parameters
iFieldNoNumber of field to retrieve
iFieldDecimalOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetFieldLen() [1/2]

xbInt16 xb::xbDbf::GetFieldLen ( const xbString sFieldName,
xbInt16 &  iFieldLen 
) const
virtual

Get field length for field name.

This function retrieves a field's length.

Parameters
sFieldNameName of field to retrieve
iFieldLenOutput field length value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetFieldLen() [2/2]

xbInt16 xb::xbDbf::GetFieldLen ( xbInt16  iFieldNo,
xbInt16 &  iFieldLen 
) const
virtual

Get field length for field number.

This function retrieves a field's length.

Parameters
iFieldNoName of field to retrieve
iFieldLenOutput field length value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetFieldName()

xbInt16 xb::xbDbf::GetFieldName ( xbInt16  iFieldNo,
xbString sFieldName 
) const
virtual

Returns the name of the specified field.

Returns a pointer to the name for the field specified by iFieldNo.

Parameters
iFieldNoNumber of field.
sFieldNameOutput variable containing the field name.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetFieldNo() [1/2]

xbInt16 xb::xbDbf::GetFieldNo ( const xbString sFieldName) const
virtual

Get field ID number for a given field name.

Returns the field number for the named field.

Parameters
sFieldNameName of field.
Returns
Number of field or XB_INVALID_FIELD_NAME.

◆ GetFieldNo() [2/2]

xbInt16 xb::xbDbf::GetFieldNo ( const xbString sFieldName,
xbInt16 &  iFieldNo 
) const
virtual

Get the field number for name.

Returns the field number for the named field.

All field get/put methods require either a field number or field name as one of the parameters. Using the methods that take the field numbers will yield slightly better performance because the methods that take a name, have to look up the number.

Parameters
sFieldNameName of field.
iFieldNoOutput field number for the given name.
Returns
Number of field named fldName.

◆ GetFieldType() [1/2]

xbInt16 xb::xbDbf::GetFieldType ( const xbString sFieldName,
char &  cFieldType 
) const
virtual

Get field type for field name.

Parameters
sFieldNameField name.
cFieldTypeOutput field type.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetFieldType() [2/2]

xbInt16 xb::xbDbf::GetFieldType ( xbInt16  iFieldNo,
char &  cFieldType 
) const
virtual

Get field type for field number.

Parameters
iFieldNoField number.
cFieldTypeOutput field type.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetFileDirPart() [1/2]

xbInt16 xb::xbFile::GetFileDirPart ( const xbString sCompleteFileNameIn,
xbString sFileDirPartOut 
) const
inherited

Get the directory part of the file name.

Parameters
sCompleteFileNameIn- a fully qualfied input file name
sFileDirPartOut- the returned directory name part out of sCompleteFileNameIn
Returns
Return Codes

◆ GetFileDirPart() [2/2]

xbInt16 xb::xbFile::GetFileDirPart ( xbString sFileDirPartOut) const
inherited

Get the directory part of the file name.

Parameters
sFileDirPartOut- the returned directory name
Returns
Return Codes

◆ GetFileExtPart() [1/2]

xbInt16 xb::xbFile::GetFileExtPart ( const xbString sCompleteFileNameIn,
xbString sFileExtPartOut 
) const
inherited

Get the extension part of the file name.

Parameters
sCompleteFileNameIn- a fully qualfied input file name
sFileExtPartOut- the returned directory name part out of sCompleteFileNameIn
Returns
Return Codes

◆ GetFileExtPart() [2/2]

xbInt16 xb::xbFile::GetFileExtPart ( xbString sFileNameExtOut) const
inherited

Get the extension part of the file name.

Parameters
sFileNameExtOut- the returned extension part out of sCompleteFileNameIn
Returns
Return Codes

◆ GetFileMtime()

xbInt16 xb::xbFile::GetFileMtime ( time_t &  mtime)
inherited

Get the time of last file modification timestamp as reported by the OS.

Parameters
mtime- returned time of last file modification
Returns
Return Codes

◆ GetFileName()

const xbString & xb::xbFile::GetFileName ( ) const
inherited

Get the file name.

Returns
the file name portion of the file

◆ GetFileNamePart() [1/2]

xbInt16 xb::xbFile::GetFileNamePart ( const xbString sCompleteFileNameIn,
xbString sFileNamePartOut 
) const
inherited

Get the name part of the file name.

Parameters
sCompleteFileNameIn- a fully qualified input file name
sFileNamePartOut- the returned file name part out of sCompleteFileNameIn
Returns
Return Codes

◆ GetFileNamePart() [2/2]

xbInt16 xb::xbFile::GetFileNamePart ( xbString sFileNamePartOut) const
inherited

Get the name part of the file name.

Parameters
sFileNamePartOut- the returned file name part out of sCompleteFileNameIn
Returns
Return Codes

◆ GetFileSize()

xbInt16 xb::xbFile::GetFileSize ( xbUInt64 &  ullFileSize)
inherited

Get the size of the file as reported by the OS.

Parameters
ullFileSize- unsigned long long field as output
Returns
Return Codes

◆ GetFileType()

xbInt16 xb::xbFile::GetFileType ( xbString sFileTypeOut) const
inherited

Get the file type aka Capitalized file extension.

Parameters
sFileTypeOut- the returned extension part out of sCompleteFileNameIn
Returns
Return Codes

◆ GetFirstRecord() [1/2]

xbInt16 xb::xbDbf::GetFirstRecord ( )
virtual

Get the first record.

Get the first not deleted record. This routines skips over any deleted records.

Returns
Return Codes

◆ GetFirstRecord() [2/2]

xbInt16 xb::xbDbf::GetFirstRecord ( xbInt16  iOption)
virtual

Get the first record.

Parameters
iOptionXB_ALL_RECS - Get the first record, deleted or not.
XB_ACTIVE_RECS - Get the first active record.
XB_DELETED_RECS - Get the first deleted record.
Returns
Return Codes

◆ GetFloatField() [1/2]

xbInt16 xb::xbDbf::GetFloatField ( const xbString sFieldName,
xbFloat fFieldValue 
) const
virtual

Get xbFloat field for field name.

Parameters
sFieldNameNumber of field to retrieve.
fFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetFloatField() [2/2]

xbInt16 xb::xbDbf::GetFloatField ( xbInt16  iFieldNo,
xbFloat fFieldValue 
) const
virtual

Get xbFloat field for field number.

Parameters
iFieldNoNumber of field to retrieve.
fFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetFqFileName()

const xbString & xb::xbFile::GetFqFileName ( ) const
inherited

Get the fully qualified file name.

Returns
the fully qualfied name of the file

◆ GetHeaderLen()

virtual xbUInt16 xb::xbDbf::GetHeaderLen ( ) const
virtual

◆ GetHomeDir()

void xb::xbSsv::GetHomeDir ( xbString sHomeDirOut)
inherited

Get home directory.

Parameters
sHomeDirOut- Output home directory for current user.

◆ GetLastRecord() [1/2]

xbInt16 xb::xbDbf::GetLastRecord ( )
virtual

Get the last record.

Get the last not deleted record. This routines skips over any deleted records.

Returns
Return Codes

◆ GetLastRecord() [2/2]

xbInt16 xb::xbDbf::GetLastRecord ( xbInt16  iOption)
virtual

Get the last record.

Parameters
iOptionXB_ALL_RECS - Get the last record, deleted or not.
XB_ACTIVE_RECS - Get the last active record.
XB_DELETED_RECS - Get the last deleted record.
Returns
Return Codes

◆ GetLogDirectory()

xbString & xb::xbSsv::GetLogDirectory ( ) const
inherited

◆ GetLogFileName()

xbString & xb::xbSsv::GetLogFileName ( ) const
inherited

◆ GetLogicalField() [1/5]

xbInt16 xb::xbDbf::GetLogicalField ( const xbString sFieldName,
xbBool bFieldValue 
) const
virtual

Get logical field for field name.

Parameters
sFieldNameName of field to retrieve.
bFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetLogicalField() [2/5]

xbInt16 xb::xbDbf::GetLogicalField ( const xbString sFieldName,
xbString sFieldValue 
) const
virtual

Get logical field for field name.

Parameters
sFieldNameName of field to retrieve.
sFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetLogicalField() [3/5]

xbInt16 xb::xbDbf::GetLogicalField ( xbInt16  iFieldNo,
xbBool bFieldValue 
) const
virtual

Get logical field for field number.

Parameters
iFieldNoNumber of field to retrieve.
bFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetLogicalField() [4/5]

xbInt16 xb::xbDbf::GetLogicalField ( xbInt16  iFieldNo,
xbBool bFieldValue,
xbInt16  iRecBufSw 
) const
virtual

Get logical field for field number.

Parameters
iFieldNoNumber of field to retrieve.
bFieldValueOutput field value.
iRecBufSw0 - Record buffer with any updates.
1 - Record buffer with original data.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetLogicalField() [5/5]

xbInt16 xb::xbDbf::GetLogicalField ( xbInt16  iFieldNo,
xbString sFieldValue 
) const
virtual

Get logical field for field number.

Parameters
iFieldNoNumber of field to retrieve.
sFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetLongField() [1/2]

xbInt16 xb::xbDbf::GetLongField ( const xbString sFieldName,
xbInt32 &  lFieldValue 
) const
virtual

Get long field for field name.

Parameters
sFieldNameNumber of field to retrieve.
lFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetLongField() [2/2]

xbInt16 xb::xbDbf::GetLongField ( xbInt16  iFieldNo,
xbInt32 &  lFieldValue 
) const
virtual

Get long field for field number.

Parameters
iFieldNoNumber of field to retrieve.
lFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetMultiUser()

xbBool xb::xbSsv::GetMultiUser ( ) const
inherited

Get the multi user setting.

Returns
xbTrue - Multi user mode turned on.
xbFalse - Multi user mode turned off.

◆ GetNextRecord() [1/3]

xbInt16 xb::xbDbf::GetNextRecord ( )
virtual

Get the next record.

Get the next not deleted record. This routines skips over any deleted records.

Returns
Return Codes

◆ GetNextRecord() [2/3]

xbInt16 xb::xbDbf::GetNextRecord ( xbInt16  iOption)
virtual

Get the next record.

Parameters
iOptionXB_ALL_RECS - Get the next record, deleted or not.
XB_ACTIVE_RECS - Get the next active record.
XB_DELETED_RECS - Get the next deleted record.
Returns
Return Codes

◆ GetNextRecord() [3/3]

xbInt16 xb::xbDbf::GetNextRecord ( xbInt16  iOption,
xbUInt32  ulStartRec 
)
virtual

Get the next record.

Parameters
iOptionXB_ALL_RECS - Get the next record, deleted or not.
XB_ACTIVE_RECS - Get the next active record.
XB_DELETED_RECS - Get the next deleted record.
ulStartRecGet next record, starting from ulStartRec.
Returns
Return Codes

◆ GetNullSts() [1/3]

xbInt16 xb::xbDbf::GetNullSts ( const xbString sFieldName,
xbBool bIsNull 
) const
virtual

Get field null status.

Parameters
iFieldNameField Name of field to retrieve.
bIsNullOutput field value. If field is all spaces on record buffer, returns true.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetNullSts() [2/3]

xbInt16 xb::xbDbf::GetNullSts ( xbInt16  iFieldNo,
xbBool bIsNull 
) const
virtual

Get field null status.

Parameters
iFieldNoNumber of field to retrieve.
bIsNullOutput field value. If field is all spaces on record buffer, returns true.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetNullSts() [3/3]

xbInt16 xb::xbDbf::GetNullSts ( xbInt16  iFieldNo,
xbBool bIsNull,
xbInt16  iRecBufSw 
) const
virtual

Get field null status.

Parameters
iFieldNoNumber of field to retrieve.
bIsNullOutput field value. If field is all spaces on record buffer, returns true.
iRecBufSw0 - Record buffer with any updates.
1 - Record buffer with original data.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetOpenMode()

xbInt16 xb::xbFile::GetOpenMode ( ) const
inherited

Get the open mode of the file.

Returns
XB_READ
XB_READ_WRITE
XB_WRITE

◆ GetPathSeparator()

char xb::xbSsv::GetPathSeparator ( ) const
inherited

Get the OS dependent path separator.

Returns
Returns '\' for windows environment, otherwise returns '/'.

◆ GetPrevRecord() [1/2]

xbInt16 xb::xbDbf::GetPrevRecord ( )
virtual

Get the previous record.

Get the previous not deleted record. This routine skips over any deleted records.

Returns
Return Codes

◆ GetPrevRecord() [2/2]

xbInt16 xb::xbDbf::GetPrevRecord ( xbInt16  iOption)
virtual

Get the previous record.

Parameters
iOptionXB_ALL_RECS - Get the previous record, deleted or not.
XB_ACTIVE_RECS - Get the previous active record.
XB_DELETED_RECS - Get the previous deleted record.
Returns
Return Codes

◆ GetRawField()

xbInt16 xb::xbDbf::GetRawField ( xbInt16  iFieldNo,
char *  cBuf,
xbUInt32  ulBufSize,
xbInt16  iRecBufSw 
) const
protectedvirtual

Get raw field data for field number.

This is a protected method, used by other methods. This method would be subject to buffer overflows if made public.

Parameters
iFieldNoNumber of field to retrieve.
cBufPointer to buffer area provided by calling application program.
ulBufSizeSize of data to copy
iRecBufSw0 - Record buffer with any updates.
1 - Record buffer with original data.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetRecord()

xbInt16 xb::xbDbf::GetRecord ( xbUInt32  ulRecNo)
virtual

Get record for specified record number.

Retrieve a record from disk and load it into the record buffer. If auto commit is enabled and there are pending updates, this routine will flush the updates to disk before proceeding to ulRecNo.

Parameters
ulRecNo- Record number to retrieve.
Returns
Return Codes

◆ GetRecordBuf()

char * xb::xbDbf::GetRecordBuf ( xbInt16  iOpt = 0) const
virtual

Get pointer to record buffer.

Parameters
iOpt0 for RecBuf (current) or 1 for RecBuf2 (original contents)
Returns
Pointer to record buffer.

◆ GetRecordCnt()

xbInt16 xb::xbDbf::GetRecordCnt ( xbUInt32 &  ulRecCnt)
virtual

Get the current number of records in the dbf data file.

Returns
Record count or Return Codes

Get the current number of records in the dbf data file.

Parameters
ulRecCntOutput number of records in file.
Returns
Return Codes

◆ GetRecordLen()

xbUInt16 xb::xbDbf::GetRecordLen ( ) const
virtual

Get the dbf record length.

Returns
Record length.

◆ GetShareMode()

xbInt16 xb::xbFile::GetShareMode ( ) const
inherited

Get the share mode of the file.

Returns
XB_SINGLE_USER - (file buffering on>
XB_MULTI_USER - (file buffering off)

◆ GetTblAlias()

const xbString & xb::xbDbf::GetTblAlias ( ) const
virtual

Get the table alias.

This routine returns the table alias.

Returns
Table alias

◆ GetTempDirectory()

xbString & xb::xbSsv::GetTempDirectory ( ) const
inherited

Get the current temp directory.

Returns
xbString containing the current data directory where the database files are stored.

◆ GetULongField() [1/2]

xbInt16 xb::xbDbf::GetULongField ( const xbString sFieldName,
xbUInt32 &  ulFieldValue 
) const
virtual

Get unsigned long field for field name.

Parameters
sFieldNameNumber of field to retrieve.
ulFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetULongField() [2/2]

xbInt16 xb::xbDbf::GetULongField ( xbInt16  iFieldNo,
xbUInt32 &  ulFieldValue 
) const
virtual

Get unsigned long field for field number.

Parameters
iFieldNoNumber of field to retrieve.
ulFieldValueOutput field value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ GetVersion()

virtual xbInt16 xb::xbDbf::GetVersion ( ) const
pure virtual

◆ GetXbaseFileTypeByte() [1/3]

xbInt16 xb::xbFile::GetXbaseFileTypeByte ( const xbString sFileName,
unsigned char &  cFileTypeByte 
)
inherited

Get the file type byte and version of the dbf file.

Pull the first bye off the DBF file for further inspection. First byte has various bits set to determine what the file format is.

Parameters
sFileName- Name of file to examine
cFileTypeByte- Retruned first byte of dbf file
Returns
Return Codes

◆ GetXbaseFileTypeByte() [2/3]

xbInt16 xb::xbFile::GetXbaseFileTypeByte ( const xbString sFileName,
unsigned char &  cFileTypeByte,
xbInt16 &  iVersion 
)
inherited

Get the file type byte and version of the dbf file.

Pull the first bye off the DBF file for further inspection. First byte has various bits set to determine what the file format is.

Parameters
sFileName- Name of file to examine
cFileTypeByte- Returned first byte of dbf file
iVersion- Returned file version
Returns
Return Codes

◆ GetXbaseFileTypeByte() [3/3]

xbInt16 xb::xbFile::GetXbaseFileTypeByte ( const xbString sFileName,
xbInt16 &  iVersion 
)
inherited

Get the file type byte and version of the dbf file.

Pull the first bye off the DBF file for further inspection. First byte has various bits set to determine what the file format is.

Parameters
sFileName- Name of file to examine
iVersion- Returned file version
Returns
Return Codes

◆ GetXbasePtr()

xbXBase * xb::xbDbf::GetXbasePtr ( ) const
virtual

Get the pointer to the xbXbase structure,.

Returns
Pointer to xbXbase structure.

◆ InitVars()

void xb::xbDbf::InitVars ( )
protectedvirtual

◆ MemoFieldsExist()

xbBool xb::xbDbf::MemoFieldsExist ( ) const
virtual

Check for existence of any memo fields.

Returns
xbTrue - Memo fields exist.
xbFalse - Memo fields don't exist.

◆ NameSuffixMissing()

xbInt16 xb::xbFile::NameSuffixMissing ( const xbString sFileName,
xbInt16  iOption 
) const
inherited

Determines status of file extension.

Parameters
sFileName- Name of file to examine
iOption- Inspection type
1 check for DBF
2 check for NDX
3 check for MDX
4 check for NTX
Returns
0 if suffix found
1 if suffix not found, lower case
2 is suffix not found, upper case

◆ Open() [1/3]

xbInt16 xb::xbDbf::Open ( const xbString sTableName)
virtual

Open a table/dbf file.

This routine sets the alias name to the same as the table name.

Parameters
sTableNameTable name to open, Include the .dbf or .DBF extension.
Returns
Return Codes

◆ Open() [2/3]

xbInt16 xb::xbDbf::Open ( const xbString sTableName,
const xbString sAlias 
)
virtual

Open a table/dbf file.

Parameters
sTableNameTable name to open, Include the .dbf or .DBF extension.
sAliasAlias name to assign to this entry.
Returns
Return Codes

◆ Open() [3/3]

virtual xbInt16 xb::xbDbf::Open ( const xbString sTableName,
const xbString sAlias,
xbInt16  iOpenMode,
xbInt16  iShareMode 
)
pure virtual

◆ Pack() [1/2]

xbInt16 xb::xbDbf::Pack ( )
virtual

Pack dbf file.

This routine eliminates all deleted records from the file.

Returns
Return Codes

◆ Pack() [2/2]

xbInt16 xb::xbDbf::Pack ( xbUInt32 &  ulDeletedRecCnt)
virtual

Pack dbf file.

This routine eliminates all deleted records from the file and clears out any unused blocks in the memo file if one exists.

Parameters
ulDeletedRecCnt- Output - number of recrods removed from the file.
Returns
Return Codes

◆ PutDateField() [1/2]

xbInt16 xb::xbDbf::PutDateField ( const xbString sFieldName,
const xbDate dtFieldValue 
)
virtual

Put date field for field name.

Parameters
sFieldNameName of field to update.
dtFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutDateField() [2/2]

xbInt16 xb::xbDbf::PutDateField ( xbInt16  iFieldNo,
const xbDate dtFieldValue 
)
virtual

Put date field for field number.

Parameters
iFieldNoNumber of field to update.
dtFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutDoubleField() [1/2]

xbInt16 xb::xbDbf::PutDoubleField ( const xbString sFieldName,
xbDouble  dFieldValue 
)
virtual

Put double field for field name.

Parameters
sFieldNameName of field to update.
dFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutDoubleField() [2/2]

xbInt16 xb::xbDbf::PutDoubleField ( xbInt16  iFieldNo,
xbDouble  dFieldValue 
)
virtual

Put double field for field number.

Parameters
iFieldNoNumber of field to update.
dFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutField() [1/2]

xbInt16 xb::xbDbf::PutField ( const xbString sFieldName,
const xbString sFieldValue 
)
virtual

Put field for field name.

Parameters
sFieldNameName of field to update.
sFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutField() [2/2]

xbInt16 xb::xbDbf::PutField ( xbInt16  iFieldNo,
const xbString sFieldValue 
)
virtual

Put field for field number.

Parameters
iFieldNoNumber of field to update.
sFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutFloatField() [1/2]

xbInt16 xb::xbDbf::PutFloatField ( const xbString sFieldName,
xbFloat  fFieldValue 
)
virtual

Put float field for field name.

Parameters
sFieldNameName of field to update.
fFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutFloatField() [2/2]

xbInt16 xb::xbDbf::PutFloatField ( xbInt16  iFieldNo,
xbFloat  fFieldValue 
)
virtual

Put float field for field number.

Parameters
iFieldNoNumber of field to update.
fFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutLogicalField() [1/4]

xbInt16 xb::xbDbf::PutLogicalField ( const xbString sFieldName,
const xbString sFieldValue 
)
virtual

Put logical field for field name.

Parameters
sFieldNameName of field to update.
sFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutLogicalField() [2/4]

xbInt16 xb::xbDbf::PutLogicalField ( const xbString sFieldName,
xbBool  bFieldValue 
)
virtual

Put logical field for field name.

Parameters
sFieldNameName of field to update.
bFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutLogicalField() [3/4]

xbInt16 xb::xbDbf::PutLogicalField ( xbInt16  iFieldNo,
const xbString sFieldValue 
)
virtual

Put logical field for field number.

Parameters
iFieldNoNumber of field to update.
sFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutLogicalField() [4/4]

xbInt16 xb::xbDbf::PutLogicalField ( xbInt16  iFieldNo,
xbBool  bFieldValue 
)
virtual

Put logical field for field number.

Parameters
iFieldNoNumber of field to update.
bFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutLongField() [1/2]

xbInt16 xb::xbDbf::PutLongField ( const xbString sFieldName,
xbInt32  lFieldValue 
)
virtual

Put long field for field name.

Parameters
sFieldNameName of field to update.
lFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutLongField() [2/2]

xbInt16 xb::xbDbf::PutLongField ( xbInt16  iFieldNo,
xbInt32  lFieldValue 
)
virtual

Put long field for field number.

Parameters
iFieldNoNumber of field to update.
lFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutRecord() [1/2]

xbInt16 xb::xbDbf::PutRecord ( )
virtual

Write the current record to disk.

This routine is used to write any updates to the current record buffer to disk.

Returns
Return Codes

◆ PutRecord() [2/2]

xbInt16 xb::xbDbf::PutRecord ( xbUInt32  ulRecNo)
virtual

Write record to disk.

This routine is used to write a copy of the current record buffer to disk for a given record number.

Parameters
ulRecNoRecord number to update.
Returns
Return Codes

◆ PutULongField() [1/2]

xbInt16 xb::xbDbf::PutULongField ( const xbString sFieldName,
xbUInt32  ulFieldValue 
)
virtual

Put unsigned long field for field name.

Parameters
sFieldNameName of field to update.
ulFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ PutULongField() [2/2]

xbInt16 xb::xbDbf::PutULongField ( xbInt16  iFieldNo,
xbUInt32  ulFieldValue 
)
virtual

Put unsigned long field for field number.

Parameters
iFieldNoNumber of field to update.
ulFieldValueField value.
Returns
The field routines return one of:
XB_NO_ERROR
XB_INVALID_DATA
XB_INVALID_FIELD_NO
XB_INVALID_FIELD_NAME
XB_INVALID_FIELD_TYPE
XB_INVALID_DATA

◆ ReadBlock() [1/2]

xbInt16 xb::xbFile::ReadBlock ( xbUInt32  ulBlockNo,
size_t  lReadSize,
void *  buf 
)
inherited

Read a block of data from file.

Parameters
ulBlockNo- block number to read
lReadSize- size of data to read at block location, set to 0 to read blocksize
*buf- pointer to buffer to write output data, assumed to be previosuly allocated and large enough to contain data
Returns
Return Codes

◆ ReadBlock() [2/2]

xbInt16 xb::xbFile::ReadBlock ( xbUInt32  ulBlockNo,
xbUInt32  ulBlockSize,
size_t  lReadSize,
void *  buf 
)
inherited

Read a block of data from file.

Parameters
ulBlockNo- block number to read
ulBlockSize- block size
lReadSize- size of data to read at block location, set to 0 to read blocksize
buf- pointer to buffer to write output data, assumed to be previosuly allocated and large enough to contain data
Returns
Return Codes

◆ ReadHeader()

xbInt16 xb::xbDbf::ReadHeader ( xbInt16  iPositionOption,
xbInt16  iReadOption 
)
protectedvirtual

Read dbf file header information.

This method assumes the header has been locked appropriately in a multi user environment

Parameters
iPositionOption0 - Don't fseek to beginning of file before read.
1 - Start from beginning of file.
iReadOption0 - Read entire 32 byte header
1 - Read first eight bytes which includes the last update date and number of records.
Returns
Return Codes

◆ RecordDeleted()

xbInt16 xb::xbDbf::RecordDeleted ( xbInt16  iOpt = 0) const
virtual

Return record deletion status.

This routine returns the record deletion status.

Parameters
iOpt0 = Current record buffer, 1 = Original record buffer
Returns
xbTrue - Record deleted.
xbFalse - Record not deleted.

◆ Rename()

virtual xbInt16 xb::xbDbf::Rename ( const xbString  sNewName)
pure virtual

◆ SetAutoCommit()

xbInt16 xb::xbDbf::SetAutoCommit ( xbInt16  iAutoCommit)
virtual

Set auto commit.

This routine sets the auto commit setting for this table.

Returns
XB_NO_ERROR;

◆ SetBlockSize()

xbInt16 xb::xbFile::SetBlockSize ( xbUInt32  ulBlockSize)
inherited

Set the block size.

Parameters
ulBlockSize- unsigned long block size, divisible by 512
Returns
Return Codes

◆ SetDataDirectory()

void xb::xbSsv::SetDataDirectory ( const xbString sDataDirectory)
inherited

Set the data directory.

Parameters
sDataDirectorySet the data directory.

◆ SetDefaultAutoCommit()

void xb::xbSsv::SetDefaultAutoCommit ( xbBool  bDefaultAutoCommit)
inherited

Set the default auto commit.

Disabling auto commit requires the application execute explicit updates using dbf->Put() and dbf->AppendRecord(). With auto commit on, the library posts updates automatically when moving off the current record or closing a file.

Parameters
bDefaultAutoCommitxbTrue - Enable default auto commit.
xbFalse - Disable default auto commit.

◆ SetDefaultDateFormat()

void xb::xbSsv::SetDefaultDateFormat ( const xbString sDefaultDateFormat)
inherited

Set the default date format.

Parameters
sDefaultDateFormatSet the default date format.

◆ SetDirectory()

void xb::xbFile::SetDirectory ( const xbString sDirectory)
inherited

Set the directory.

Parameters
sDirectory- Valid directory name

◆ SetEndianType()

void xb::xbSsv::SetEndianType ( )
protectedinherited

Set the endian type.

This routine determines the Endian-ness at run time instead of compile time as some processers (ie; Sparc,ARM) can be switched either way. This routine is called automatically by the library at startup and does not need to be called in an application program.

◆ SetFileName()

void xb::xbFile::SetFileName ( const xbString sFileName)
inherited

Set the filename.

This routine builds out two internal variables from the input file name
sFileName - the file name part
sFqFileName - the fully qualified file name

Parameters
sFileName- Input file name

◆ SetFqFileName()

void xb::xbFile::SetFqFileName ( const xbString sFqFileName)
inherited

Set the fully qualifed filename.

Parameters
sFqFileName- Fully qualifed input file name

◆ SetHomeFolders()

xbInt16 xb::xbFile::SetHomeFolders ( )
inherited

Set Home Folders.

Create xbase64 log, data and temp folders in the home directory for current usre.

Returns
Return Codes

◆ SetLogDirectory()

void xb::xbSsv::SetLogDirectory ( const xbString sLogDirectory)
inherited

◆ SetLogFileName()

void xb::xbSsv::SetLogFileName ( const xbString sLogFileName)
inherited

◆ SetMultiUser()

void xb::xbSsv::SetMultiUser ( xbBool  bMultiUser)
inherited

Get the multi user setting.

Parameters
bMultiUserxbTrue - Turn on Multi user mode.
xbFalse - Turn off Multi user mode.

◆ SetTempDirectory()

void xb::xbSsv::SetTempDirectory ( const xbString sTempDirectory)
inherited

Set the temp directory.

Parameters
sTempDirectorySet the data direcroty.

◆ SetVersion()

virtual xbInt16 xb::xbDbf::SetVersion ( )
protectedpure virtual

◆ UndeleteAllRecords()

xbInt16 xb::xbDbf::UndeleteAllRecords ( )
virtual

Set auto lock.

This routine sets the auto lock setting for this table. There is an overall system level auto lock default setting and each table can have it's own autolock setting. This method controls the table level auto lock setting.

Parameters
iAutoLock1 - Use auto lock for this table.
0 - Don't use auto lock for this table.
-1 - (minus one) Use system default.
Returns
Return Codes

Set the header locked status.

Parameters
bHeaderLockedxbTrue - Locked
xbFalse - Not locked.
Returns
void

Set lock flavor.

This routine is for future expansion.

Parameters
iLockFlavor1 - Use Dbase (tm) style locking.
Returns
void

Set table locked status.

Parameters
bTableLocked- xbTrue Table locked.
xbFalse Table unlocked.
Returns
void

Undelete all records.

This routine will remove the deletion flag on any deleted records in the table.

Returns
Return Codes

◆ UndeleteRecord()

xbInt16 xb::xbDbf::UndeleteRecord ( )
virtual

Undelete one record.

This routine will undelete the current record, if it is deleted.

Returns
XB_NO_ERROR
XB_INVALID_RECORD

◆ ValidateSchema()

virtual xbInt16 xb::xbDbf::ValidateSchema ( xbSchema s)
protectedpure virtual

◆ WriteBlock()

xbInt16 xb::xbFile::WriteBlock ( xbUInt32  ulBlockNo,
size_t  lWriteSize,
void *  buf 
)
inherited

Write a block of data to file.

Parameters
ulBlockNo- block number to write
lWriteSize- size of data to write, set to 0 to write blocksize
*buf- pointer to buffer of data to be written
Returns
Return Codes

◆ WriteHeader()

xbInt16 xb::xbDbf::WriteHeader ( xbInt16  iPositionOption,
xbInt16  iWriteOption 
)
protected

◆ xbFclose()

xbInt16 xb::xbFile::xbFclose ( )
inherited

Xbase wrapper for standard libary fclose.

Returns
Return Codes

◆ xbFeof()

xbInt16 xb::xbFile::xbFeof ( )
inherited

Xbase wrapper for standard libary feof.

Returns
non zero if end-of-file is set for the stream.

◆ xbFflush()

xbInt16 xb::xbFile::xbFflush ( )
inherited

Xbase wrapper for standard libary fflush.

Returns
Return Codes

◆ xbFgetc() [1/2]

xbInt16 xb::xbFile::xbFgetc ( char &  c)
inherited

Xbase wrapper for standard libary fgetc.

Parameters
c- output character returned by fgetc
Returns
Return Codes

◆ xbFgetc() [2/2]

xbInt16 xb::xbFile::xbFgetc ( xbInt32 &  c)
inherited

Xbase wrapper for standard libary fgetc.

Parameters
c- output integer returned by fgetc
Returns
Return Codes

◆ xbFgets()

xbInt16 xb::xbFile::xbFgets ( size_t  lSize,
xbString s 
)
inherited

Xbase wrapper for standard libary fgets.

Parameters
lSize- reads in at most, one character less than lSize
s- an xbString containing data returned by fseek
Returns
Return Codes

◆ xbFopen() [1/4]

xbInt16 xb::xbFile::xbFopen ( const xbString sOpenMode,
const xbString sFileName,
xbInt16  iShareMode 
)
inherited

Xbase wrapper for standard libary fopen.

This routine supports all the standard C library open modes. The Xbase routines only use "r" and "r+b".

Parameters
sOpenMode
OpenModeDescription
rReading
r+Reading and Writing
wOpen for writing. Truncate to zero bytes if it exists
w+Open for reading and writing, truncate to zero bytes if it exists
aOpen for append
a+Open for reading and writing (at end).
The mode can also include the letter "b" for binary ie; "r+b". The "b" is ignored on POSIX compliant systems, but is included for cross platform compatibility.
sFileNameFile name to open
iShareModeXB_SINGLE_USER
XB_MULTI_USER
Returns
Return Codes

◆ xbFopen() [2/4]

xbInt16 xb::xbFile::xbFopen ( const xbString sOpenMode,
xbInt16  iShareMode 
)
inherited

Xbase wrapper for standard libary fopen.

This routine supports all the standard C library open modes. The Xbase routines only use "r" and "r+".

Parameters
sOpenMode
OpenModeDescription
rReading
r+Reading and Writing
wOpen for writing. Truncate to zero bytes if it exists
w+Open for reading and writing, truncate to zero bytes if it exists
aOpen for append
a+Open for reading and writing (at end).
The mode can also include the letter "b" for binary ie; "r+b". The "b" is ignored on POSIX compliant systems, but is included for cross platform compatibility.
iShareModeXB_SINGLE_USER
XB_MULTI_USER
Returns
Return Codes

◆ xbFopen() [3/4]

xbInt16 xb::xbFile::xbFopen ( xbInt16  iOpenMode)
inherited

◆ xbFopen() [4/4]

xbInt16 xb::xbFile::xbFopen ( xbInt16  iOpenMode,
xbInt16  iShareMode 
)
inherited

Xbase wrapper for standard libary fopen.

Parameters
iOpenModeXB_READ
XB_READ_WRITE
iShareModeXB_SINGLE_USER
XB_MULTI_USER
Returns
Return Codes

◆ xbFputc() [1/2]

xbInt16 xb::xbFile::xbFputc ( xbInt32  c)
inherited

Xbase wrapper for standard libary fputc.

Parameters
cCharacter to write
Returns
Return Codes

◆ xbFputc() [2/2]

xbInt16 xb::xbFile::xbFputc ( xbInt32  c,
xbInt32  iNoOfTimes 
)
inherited

Xbase wrapper for standard libary fputc.

Parameters
cCharacter to write
iNoOfTimesNumber of times to write the character
Returns
Return Codes

◆ xbFputs()

xbInt16 xb::xbFile::xbFputs ( const xbString s)
inherited

Xbase wrapper for standard libary fputs.

Parameters
sxbString to write to file
Returns
Return Codes

◆ xbFread()

xbInt16 xb::xbFile::xbFread ( void *  p,
size_t  size,
size_t  nmemb 
)
inherited

Xbase wrapper for standard libary fread.

Parameters
pPointer to data to write
sizesize of write
nmembNumber of times to read it
Returns
Return Codes

◆ xbFseek()

xbInt16 xb::xbFile::xbFseek ( xbInt64  lOffset,
xbInt32  iWhence 
)
inherited

Xbase wrapper for standard libary fseek.

Parameters
lOffsetPosition in file to seek to
iWhenceSEEK_SET - from beginning of file
SEEK_CUR - from current position
SEEK_END - from end of file
Returns
Return Codes

◆ xbFtell()

size_t xb::xbFile::xbFtell ( )
inherited

Xbase wrapper for standard libary ftell.

Returns the current file position.

Returns
Current file position.

◆ xbFTurnOffFileBuffering()

void xb::xbFile::xbFTurnOffFileBuffering ( )
inherited

Turn off file buffering.

Turns off file buffering. File buffering can't be used while in multi user mode.

◆ xbFwrite()

xbInt16 xb::xbFile::xbFwrite ( const void *  p,
size_t  size,
size_t  nmemb 
)
inherited

Xbase wrapper for standard libary fwrite.

Parameters
pPointer to data buffer to write
sizeSize of data to write
nmembNumber of times to write data buffer
Returns
Return Codes

◆ xbReadUntil()

xbInt16 xb::xbFile::xbReadUntil ( const char  cDelim,
xbString sOut 
)
inherited

Read file until a particular character is encountered on input stream.

This routine will read until cDelim is encountered or eof, which ever occurs first.

Parameters
cDelimDelimiter to stop writing at.
sOutOutput xbString containing data read
Returns
Return Codes

◆ xbRemove() [1/3]

xbInt16 xb::xbFile::xbRemove ( )
inherited

Delete file.

Returns
Return Codes

◆ xbRemove() [2/3]

xbInt16 xb::xbFile::xbRemove ( const xbString sFileNameIn)
inherited

Delete file.

Parameters
sFileNameInName of file to delete
Returns
Return Codes

◆ xbRemove() [3/3]

xbInt16 xb::xbFile::xbRemove ( const xbString sFileNameIn,
xbInt16  iOption 
)
inherited

Delete file.

Parameters
sFileNameInName of file to delete
iOptionIf Set to 1, assume this is a delete request for a dbf file, and should rename the dbt file also
Returns
Return Codes

◆ xbRename()

xbInt16 xb::xbFile::xbRename ( const xbString sOldName,
const xbString sNewName 
)
inherited

Rename file.

Parameters
sOldNameOriginal file name
sNewNameNew file name
Returns
Return Codes

◆ xbRewind()

void xb::xbFile::xbRewind ( )
inherited

Xbase wrapper for rewind.

Set file pointer at beginning of file.

◆ xbTruncate()

xbInt16 xb::xbFile::xbTruncate ( xbInt64  llSize)
inherited

Xbase wrapper for ftruncate.

Set file size to llSize

Parameters
llSizeNew file size.
Returns
Return Codes

◆ Zap()

xbInt16 xb::xbDbf::Zap ( )
virtual

Zap (remove) everything from the file,.

This routine eliminates everything from the dbf file and dbt memo file.

Returns
Return Codes

Field Documentation

◆ cEncryptionFlag

char xb::xbDbf::cEncryptionFlag
protected

◆ cIndexFlag

char xb::xbDbf::cIndexFlag
protected

◆ cLangDriver

char xb::xbDbf::cLangDriver
protected

◆ cTransactionFlag

char xb::xbDbf::cTransactionFlag
protected

◆ cUpdateDD

char xb::xbDbf::cUpdateDD
protected

◆ cUpdateMM

char xb::xbDbf::cUpdateMM
protected

◆ cUpdateYY

char xb::xbDbf::cUpdateYY
protected

◆ cVersion

unsigned char xb::xbDbf::cVersion
protected

◆ ErrorCodeText

const char* xb::xbSsv::ErrorCodeText[]
staticinherited

◆ iAutoCommit

xbInt16 xb::xbDbf::iAutoCommit
protected

◆ iDbfStatus

xbInt16 xb::xbDbf::iDbfStatus
protected

◆ iEndianType

xbInt16 xb::xbSsv::iEndianType = 0
staticprotectedinherited

◆ iFileVersion

xbInt16 xb::xbDbf::iFileVersion
protected

◆ iNoOfFields

xbInt16 xb::xbDbf::iNoOfFields
protected

◆ RecBuf

char* xb::xbDbf::RecBuf
protected

◆ RecBuf2

char* xb::xbDbf::RecBuf2
protected

◆ sAlias

xbString xb::xbDbf::sAlias
protected

◆ SchemaPtr

xbSchemaRec* xb::xbDbf::SchemaPtr
protected

◆ sNullString

xbString xb::xbSsv::sNullString = ""
staticprotectedinherited

◆ uiHeaderLen

xbUInt16 xb::xbDbf::uiHeaderLen
protected

◆ uiRecordLen

xbUInt16 xb::xbDbf::uiRecordLen
protected

◆ ulCurRec

xbUInt32 xb::xbDbf::ulCurRec
protected

◆ ulNoOfRecs

xbUInt32 xb::xbDbf::ulNoOfRecs
protected

◆ xbase

xbXBase* xb::xbFile::xbase
protectedinherited

The documentation for this class was generated from the following files: