Xbase64 4.0.1
C++ Library for handling Xbase (DBF) format type files
|
Class for handling low level file I/O. More...
#include <xbfile.h>
Public Member Functions | |
xbFile (xbXBase *x) | |
Class Constructor. More... | |
~xbFile () | |
Class Destructor. More... | |
xbInt16 | CreateUniqueFileName (const xbString &sDirIn, const xbString &sExtIn, xbString &sFqnOut) |
Create a unique file name. More... | |
xbInt16 | CreateUniqueFileName (const xbString &sDirIn, const xbString &sExtIn, xbString &sFqnOut, xbInt16 iOption) |
Create a unique file name. More... | |
const xbString & | GetDirectory () const |
Get the directory name. More... | |
const xbString & | GetFileName () const |
Get the file name. More... | |
const xbString & | GetFqFileName () const |
Get the fully qualified file name. 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... | |
xbUInt32 | GetBlockSize () const |
Get the block size. More... | |
xbInt16 | SetBlockSize (xbUInt32 ulBlockSize) |
Set the block size. More... | |
xbInt16 | GetOpenMode () const |
Get the open mode of the file. More... | |
xbInt16 | GetShareMode () const |
Get the share mode of the file. 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 | 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 | GetFileType (xbString &sFileType) const |
Get the file type aka Capitalized file extension. 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 | 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... | |
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... | |
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 | WriteBlock (xbUInt32 ulBlockNo, size_t writeSize, void *buf) |
Write a block of data to file. More... | |
xbInt16 | GetFileSize (xbUInt64 &ullFileSize) |
Get the size of the file as reported by the OS. More... | |
xbInt16 | GetFileMtime (time_t &mtime) |
Get the time of last file modification timestamp as reported by the OS. 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... | |
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 | 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 | xbFgets (size_t lSize, xbString &sLine) |
Xbase wrapper for standard libary fgets. More... | |
size_t | xbFtell () |
Xbase wrapper for standard libary ftell. More... | |
xbInt16 | xbFseek (xbInt64 llOffset, xbInt32 whence) |
Xbase wrapper for standard libary fseek. More... | |
void | xbFTurnOffFileBuffering () |
Turn off file buffering. More... | |
xbInt16 | xbFwrite (const void *ptr, size_t lSize, size_t lNmemb) |
Xbase wrapper for standard libary fwrite. 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 | xbTruncate (xbInt64 llSize) |
Xbase wrapper for ftruncate. More... | |
xbInt16 | NameSuffixMissing (const xbString &sFileName, xbInt16 iOption) const |
Determines status of file extension. More... | |
void | DisplayError (xbInt16 ErrorCode) const |
Display error message on console for a given error number. More... | |
xbString & | GetDefaultDateFormat () const |
Get the default date format. More... | |
xbString & | GetDataDirectory () const |
Get the current data directory. More... | |
xbInt16 | GetEndianType () const |
Get the Endian type. More... | |
const char * | GetErrorMessage (xbInt16 ErrorCode) const |
Get an error message. More... | |
void | SetDataDirectory (const xbString &sDataDirectory) |
Set the data directory. More... | |
void | SetDefaultDateFormat (const xbString &sDefaultDateFormat) |
Set the default date format. 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... | |
xbString & | GetDefaultLogDirectory () const |
xbString & | GetDefaultLogFileName () const |
void | SetDefaultLogDirectory (const xbString &sDefaultLogDirectory) |
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 | |
void | SetEndianType () |
Set the endian type. More... | |
Protected Attributes | |
xbXBase * | xbase |
Static Protected Attributes | |
static xbInt16 | iEndianType = 0 |
static xbString | sNullString = "" |
Class for handling low level file I/O.
The xbFile class is used as an abstraction layer to isolate the library from the nuances of different operating systems and machine architectures.
This module handles low level file I/O and is a base class for the (dbf) table, (dbt) memo and (ndx,mdx) index classes. Files are opened and manipulated via methods in the xbFile class.
This class handles:
1) Big and little endian reads/writes
2) 32 or 64 bit system calls, depending on OS
3) Various different c/c++ calls to open/close/read/write based on OS and compiler version
If you are wanting to port this library to a new platform, start with this class. This class could be used if you want to write a platform independent program that needs R/W file access.
xb::xbFile::xbFile | ( | xbXBase * | x | ) |
Class Constructor.
xb::xbFile::~xbFile | ( | ) |
Class Destructor.
|
inherited |
|
inherited |
|
inherited |
Check a bit in a one byte field and see if it is set.
c | One byte char field to examine. |
iBitNo | which bit to examine. |
xbInt16 xb::xbFile::CreateUniqueFileName | ( | const xbString & | sDirIn, |
const xbString & | sExtIn, | ||
xbString & | sFqnOut | ||
) |
Create a unique file name.
Given a directory and file extension as inputs, create a unique file name.
sDirIn | Directory |
sExtIn | File Extension |
sFqnOut | A fully qualifed unique file name as output |
xbInt16 xb::xbFile::CreateUniqueFileName | ( | const xbString & | sDirIn, |
const xbString & | sExtIn, | ||
xbString & | sFqnOut, | ||
xbInt16 | iOption | ||
) |
Create a unique file name.
Given a directory and file extension as inputs, create a unique file name.
sDirIn | Directory |
sExtIn | File Extension |
iOption | 0 - 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 |
sFqnOut | A fully qualifed unique file name as output |
xbInt16 xb::xbFile::DetermineXbaseMemoVersion | ( | unsigned char | cFileTypeByte | ) | const |
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.
cFileTypeByte | is an output field and is one of: 0 - none 3 - Dbase III+ 4 - Dbase IV |
xbInt16 xb::xbFile::DetermineXbaseTableVersion | ( | unsigned char | cFileTypeByte | ) | const |
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)
|
inherited |
Display error message on console for a given error number.
iErrorCode | Error number to reference |
xbDouble xb::xbFile::eGetDouble | ( | const char * | p | ) | const |
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.
p | pointer to memory containing the portable double value |
xbInt16 xb::xbFile::eGetInt16 | ( | const char * | p | ) | const |
Get a portable short value.
This routine returns a short int value from a 2 byte character stream, accounting for endian type.
p | pointer to memory containing the portable long value |
xbInt32 xb::xbFile::eGetInt32 | ( | const char * | p | ) | const |
Get a portable long value.
This routine returns a long int value from a 4 byte character stream, accounting for endian type.
p | pointer to memory containing the portable long value |
xbUInt16 xb::xbFile::eGetUInt16 | ( | const char * | p | ) | const |
Get a portable unsigned short value.
This routine returns a short unsigned int value from a 2 byte character stream, accounting for endian type.
p | pointer to memory containing the portable long value |
xbUInt32 xb::xbFile::eGetUInt32 | ( | const char * | p | ) | const |
Get a portable unsigned long value.
This routine returns an unsigned long int value from a 4 byte character stream, accounting for endian type.
p | pointer to memory containing the portable long value |
void xb::xbFile::ePutDouble | ( | char * | c, |
xbDouble | d | ||
) |
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
c | Pointer to memory to hold converted value |
d | Input value to be converted |
void xb::xbFile::ePutInt16 | ( | char * | c, |
xbInt16 | s | ||
) |
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
c | Pointer to memory to hold converted value |
s | Input value to be converted |
void xb::xbFile::ePutInt32 | ( | char * | c, |
xbInt32 | l | ||
) |
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.
c | Pointer to memory to hold converted value |
l | Input value to be converted |
void xb::xbFile::ePutUInt16 | ( | char * | c, |
xbUInt16 | s | ||
) |
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
c | Pointer to memory to hold converted value |
s | Input value to be converted |
void xb::xbFile::ePutUInt32 | ( | char * | c, |
xbUInt32 | ul | ||
) |
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.
c | Pointer to memory to hold converted value |
ul | Input value to be converted |
xbBool xb::xbFile::FileExists | ( | ) | const |
Determines if a file exists.
Determines if a file exists.
sFileName | - file name to check for |
Determines if a file exists.
sFileName | - file name to check for |
iOption | if 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 |
xbBool xb::xbFile::FileExists | ( | xbInt16 | iOption | ) | const |
Determines if a file exists.
iOption | if 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 |
xbBool xb::xbFile::FileIsOpen | ( | ) | const |
Determines if file is open.
xbUInt32 xb::xbFile::GetBlockSize | ( | ) | const |
Get the block size.
|
inherited |
Get the current data directory.
|
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().
|
inherited |
Get the default date format.
|
inherited |
|
inherited |
const xbString & xb::xbFile::GetDirectory | ( | ) | const |
Get the directory name.
|
inherited |
Get the Endian type.
|
inherited |
Get an error message.
iErrorCode | ErrorCode is the error number of description to be returned. |
xbInt16 xb::xbFile::GetFileDirPart | ( | const xbString & | sCompleteFileNameIn, |
xbString & | sFileDirPartOut | ||
) | const |
Get the directory part of the file name.
sCompleteFileNameIn | - a fully qualfied input file name |
sFileDirPartOut | - the returned directory name part out of sCompleteFileNameIn |
xbInt16 xb::xbFile::GetFileDirPart | ( | xbString & | sFileDirPartOut | ) | const |
Get the directory part of the file name.
sFileDirPartOut | - the returned directory name |
xbInt16 xb::xbFile::GetFileExtPart | ( | const xbString & | sCompleteFileNameIn, |
xbString & | sFileExtPartOut | ||
) | const |
Get the extension part of the file name.
sCompleteFileNameIn | - a fully qualfied input file name |
sFileExtPartOut | - the returned directory name part out of sCompleteFileNameIn |
xbInt16 xb::xbFile::GetFileExtPart | ( | xbString & | sFileNameExtOut | ) | const |
Get the extension part of the file name.
sFileNameExtOut | - the returned extension part out of sCompleteFileNameIn |
xbInt16 xb::xbFile::GetFileMtime | ( | time_t & | mtime | ) |
Get the time of last file modification timestamp as reported by the OS.
mtime | - returned time of last file modification |
const xbString & xb::xbFile::GetFileName | ( | ) | const |
Get the file name.
xbInt16 xb::xbFile::GetFileNamePart | ( | const xbString & | sCompleteFileNameIn, |
xbString & | sFileNamePartOut | ||
) | const |
Get the name part of the file name.
sCompleteFileNameIn | - a fully qualified input file name |
sFileNamePartOut | - the returned file name part out of sCompleteFileNameIn |
xbInt16 xb::xbFile::GetFileNamePart | ( | xbString & | sFileNamePartOut | ) | const |
Get the name part of the file name.
sFileNamePartOut | - the returned file name part out of sCompleteFileNameIn |
xbInt16 xb::xbFile::GetFileSize | ( | xbUInt64 & | ullFileSize | ) |
Get the size of the file as reported by the OS.
ullFileSize | - unsigned long long field as output |
xbInt16 xb::xbFile::GetFileType | ( | xbString & | sFileTypeOut | ) | const |
Get the file type aka Capitalized file extension.
sFileTypeOut | - the returned extension part out of sCompleteFileNameIn |
const xbString & xb::xbFile::GetFqFileName | ( | ) | const |
Get the fully qualified file name.
|
inherited |
Get the multi user setting.
xbInt16 xb::xbFile::GetOpenMode | ( | ) | const |
Get the open mode of the file.
xbInt16 xb::xbFile::GetShareMode | ( | ) | const |
Get the share mode of the file.
xbInt16 xb::xbFile::GetXbaseFileTypeByte | ( | const xbString & | sFileName, |
unsigned char & | cFileTypeByte | ||
) |
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.
sFileName | - Name of file to examine |
cFileTypeByte | - Retruned first byte of dbf file |
xbInt16 xb::xbFile::GetXbaseFileTypeByte | ( | const xbString & | sFileName, |
unsigned char & | cFileTypeByte, | ||
xbInt16 & | iVersion | ||
) |
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.
sFileName | - Name of file to examine |
cFileTypeByte | - Returned first byte of dbf file |
iVersion | - Returned file version |
xbInt16 xb::xbFile::GetXbaseFileTypeByte | ( | const xbString & | sFileName, |
xbInt16 & | iVersion | ||
) |
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.
sFileName | - Name of file to examine |
iVersion | - Returned file version |
xbInt16 xb::xbFile::NameSuffixMissing | ( | const xbString & | sFileName, |
xbInt16 | iOption | ||
) | const |
Determines status of file extension.
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 |
xbInt16 xb::xbFile::ReadBlock | ( | xbUInt32 | ulBlockNo, |
size_t | lReadSize, | ||
void * | buf | ||
) |
Read a block of data from file.
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 |
xbInt16 xb::xbFile::ReadBlock | ( | xbUInt32 | ulBlockNo, |
xbUInt32 | ulBlockSize, | ||
size_t | lReadSize, | ||
void * | buf | ||
) |
Read a block of data from file.
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 |
xbInt16 xb::xbFile::SetBlockSize | ( | xbUInt32 | ulBlockSize | ) |
Set the block size.
ulBlockSize | - unsigned long block size, divisible by 512 |
|
inherited |
Set the data directory.
sDataDirectory | Set the data direcroty. |
|
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.
bDefaultAutoCommit | xbTrue - Enable default auto commit. xbFalse - Disable default auto commit. |
|
inherited |
Set the default date format.
sDefaultDateFormat | Set the default date format. |
|
inherited |
void xb::xbFile::SetDirectory | ( | const xbString & | sDirectory | ) |
Set the directory.
sDirectory | - Valid directory name |
|
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.
void xb::xbFile::SetFileName | ( | const xbString & | sFileName | ) |
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
sFileName | - Input file name |
void xb::xbFile::SetFqFileName | ( | const xbString & | sFqFileName | ) |
Set the fully qualifed filename.
sFqFileName | - Fully qualifed input file name |
|
inherited |
Get the multi user setting.
bMultiUser | xbTrue - Turn on Multi user mode. xbFalse - Turn off Multi user mode. |
xbInt16 xb::xbFile::WriteBlock | ( | xbUInt32 | ulBlockNo, |
size_t | lWriteSize, | ||
void * | buf | ||
) |
Write a block of data to file.
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 |
xbInt16 xb::xbFile::xbFclose | ( | ) |
Xbase wrapper for standard libary fclose.
xbInt16 xb::xbFile::xbFeof | ( | ) |
Xbase wrapper for standard libary feof.
xbInt16 xb::xbFile::xbFflush | ( | ) |
Xbase wrapper for standard libary fflush.
xbInt16 xb::xbFile::xbFgetc | ( | char & | c | ) |
Xbase wrapper for standard libary fgetc.
c | - output character returned by fgetc |
xbInt16 xb::xbFile::xbFgetc | ( | xbInt32 & | c | ) |
Xbase wrapper for standard libary fgetc.
c | - output integer returned by fgetc |
xbInt16 xb::xbFile::xbFgets | ( | size_t | lSize, |
xbString & | s | ||
) |
Xbase wrapper for standard libary fgets.
lSize | - reads in at most, one character less than lSize |
s | - an xbString containing data returned by fseek |
xbInt16 xb::xbFile::xbFopen | ( | const xbString & | sOpenMode, |
const xbString & | sFileName, | ||
xbInt16 | iShareMode | ||
) |
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".
sOpenMode |
| ||||||||||||||
sFileName | File name to open | ||||||||||||||
iShareMode | XB_SINGLE_USER XB_MULTI_USER |
xbInt16 xb::xbFile::xbFopen | ( | const xbString & | sOpenMode, |
xbInt16 | iShareMode | ||
) |
Xbase wrapper for standard libary fopen.
This routine supports all the standard C library open modes. The Xbase routines only use "r" and "r+".
sOpenMode |
| ||||||||||||||
iShareMode | XB_SINGLE_USER XB_MULTI_USER |
xbInt16 xb::xbFile::xbFopen | ( | xbInt16 | iOpenMode | ) |
xbInt16 xb::xbFile::xbFopen | ( | xbInt16 | iOpenMode, |
xbInt16 | iShareMode | ||
) |
Xbase wrapper for standard libary fopen.
iOpenMode | XB_READ XB_READ_WRITE |
iShareMode | XB_SINGLE_USER XB_MULTI_USER |
xbInt16 xb::xbFile::xbFputc | ( | xbInt32 | c | ) |
xbInt16 xb::xbFile::xbFputc | ( | xbInt32 | c, |
xbInt32 | iNoOfTimes | ||
) |
Xbase wrapper for standard libary fputc.
c | Character to write |
iNoOfTimes | Number of times to write the character |
xbInt16 xb::xbFile::xbFputs | ( | const xbString & | s | ) |
xbInt16 xb::xbFile::xbFread | ( | void * | p, |
size_t | size, | ||
size_t | nmemb | ||
) |
Xbase wrapper for standard libary fread.
p | Pointer to data to write |
size | size of write |
nmemb | Number of times to write it |
xbInt16 xb::xbFile::xbFseek | ( | xbInt64 | lOffset, |
xbInt32 | iWhence | ||
) |
Xbase wrapper for standard libary fseek.
lOffset | Position in file to seek to |
iWhence | SEEK_SET - from beginning of file SEEK_CUR - from current position SEEK_END - from end of file |
size_t xb::xbFile::xbFtell | ( | ) |
Xbase wrapper for standard libary ftell.
Returns the current file position.
void xb::xbFile::xbFTurnOffFileBuffering | ( | ) |
Turn off file buffering.
Turns off file buffering. File buffering can't be used while in multi user mode.
xbInt16 xb::xbFile::xbFwrite | ( | const void * | p, |
size_t | size, | ||
size_t | nmemb | ||
) |
Xbase wrapper for standard libary fwrite.
p | Pointer to data buffer to write |
size | Size of data to write |
nmemb | Number of times to write data buffer |
xbInt16 xb::xbFile::xbReadUntil | ( | const char | cDelim, |
xbString & | sOut | ||
) |
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.
cDelim | Delimiter to stop writing at. |
sOut | Output xbString containing data read |
xbInt16 xb::xbFile::xbRemove | ( | ) |
Delete file.
xbInt16 xb::xbFile::xbRemove | ( | const xbString & | sFileNameIn | ) |
xbInt16 xb::xbFile::xbRemove | ( | const xbString & | sFileNameIn, |
xbInt16 | iOption | ||
) |
Delete file.
sFileNameIn | Name of file to delete |
iOption | If Set to 1, assume this is a delete request for a dbf file, and should rename the dbt file also |
void xb::xbFile::xbRewind | ( | ) |
Xbase wrapper for rewind.
Set file pointer at beginning of file.
xbInt16 xb::xbFile::xbTruncate | ( | xbInt64 | llSize | ) |
Xbase wrapper for ftruncate.
Set file size to llSize
llSize | New file size. |
|
staticinherited |
|
staticprotectedinherited |
|
staticprotectedinherited |
|
protected |