summaryrefslogtreecommitdiff
path: root/src/include/xbfile.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/xbfile.h')
-rwxr-xr-xsrc/include/xbfile.h139
1 files changed, 70 insertions, 69 deletions
diff --git a/src/include/xbfile.h b/src/include/xbfile.h
index af04e98..e346a75 100755
--- a/src/include/xbfile.h
+++ b/src/include/xbfile.h
@@ -56,108 +56,109 @@ This class could be used if you want to write a platform independent program tha
class XBDLLEXPORT xbFile : public xbSsv {
public:
- // xbFile();
xbFile( xbXBase * x );
-
~xbFile();
- xbInt16 SetHomeFolders();
-
- xbInt16 CreateUniqueFileName( const xbString &sDirIn, const xbString &sExtIn, xbString &sFqnOut );
- xbInt16 CreateUniqueFileName( const xbString &sDirIn, const xbString &sExtIn, xbString &sFqnOut, xbInt16 iOption );
-
const xbString& GetDirectory() const;
const xbString& GetFileName() const;
const xbString& GetFqFileName() const;
- void SetDirectory ( const xbString &sDirectory);
- void SetFileName ( const xbString &sFileName );
- void SetFqFileName( const xbString &sFqName );
- xbUInt32 GetBlockSize () const;
- xbInt16 SetBlockSize ( xbUInt32 ulBlockSize );
+ xbInt16 CreateUniqueFileName( const xbString &sDirIn, const xbString &sExtIn, xbString &sFqnOut, xbInt16 iOption = 0 );
+
+ xbInt16 DetermineXbaseTableVersion( unsigned char cFileTypeByte ) const;
+ xbInt16 DetermineXbaseMemoVersion( unsigned char cFileTypeByte ) const;
+
+ xbDouble eGetDouble ( const char *p ) const;
+ xbInt32 eGetInt32 ( const char *p ) const;
+ xbUInt32 eGetUInt32 ( const char *p ) const;
+ xbInt16 eGetInt16 ( const char *p ) const;
+ xbUInt16 eGetUInt16 ( const char *p ) const;
+ void ePutDouble ( char *p, xbDouble d );
+ void ePutInt32 ( char *p, xbInt32 l );
+ void ePutUInt32 ( char *p, xbUInt32 ul );
+ void ePutInt16 ( char *p, xbInt16 s );
+ void ePutUInt16 ( char *p, xbUInt16 s );
+
+ xbBool FileExists () const;
+ xbBool FileExists ( xbInt16 iOption ) const;
+ xbBool FileExists ( const xbString &sFileName ) const;
+ xbBool FileExists ( const xbString &sFileName, xbInt16 iOption ) const;
+ xbBool FileIsOpen () const;
- xbInt16 GetOpenMode () const;
- xbInt16 GetShareMode () const;
+ xbUInt32 GetBlockSize () const;
xbInt16 GetFileDirPart ( xbString &sFileDirPartOut ) const;
xbInt16 GetFileDirPart ( const xbString &sCompleteFileNameIn, xbString &sFileDirPartOut ) const;
xbInt16 GetFileExtPart ( xbString &sFileExtPartOut ) const;
xbInt16 GetFileExtPart ( const xbString &sCompleteFileNameIn, xbString &sFileExtPartOut ) const;
+ xbInt16 GetFileMtime ( time_t &mtime );
xbInt16 GetFileNamePart( xbString &sFileNamePartOut ) const;
xbInt16 GetFileNamePart( const xbString &sCompleteFileNameIn, xbString &sFileNamePartOut ) const;
+ xbInt16 GetFileSize ( xbUInt64 &ullFileSize );
xbInt16 GetFileType ( xbString &sFileType ) const;
+
+ xbInt16 GetOpenMode () const;
+ xbInt16 GetShareMode () const;
+
+
xbInt16 GetXbaseFileTypeByte( const xbString &sFileName, xbInt16 &iVersion );
xbInt16 GetXbaseFileTypeByte( const xbString &sFileName, unsigned char &cFileTypeByte );
xbInt16 GetXbaseFileTypeByte( const xbString &sFileName, unsigned char &cFileTypeByte, xbInt16 &iVersion );
- xbInt16 DetermineXbaseTableVersion( unsigned char cFileTypeByte ) const;
- xbInt16 DetermineXbaseMemoVersion( unsigned char cFileTypeByte ) const;
- xbBool FileExists () const;
- xbBool FileExists ( xbInt16 iOption ) const;
- xbBool FileExists ( const xbString &sFileName ) const;
- xbBool FileExists ( const xbString &sFileName, xbInt16 iOption ) const;
+ xbInt16 NameSuffixMissing( const xbString &sFileName, xbInt16 iOption ) const;
- xbBool FileIsOpen () const;
+ xbInt16 ReadBlock ( xbUInt32 ulBlockNo, size_t readSize, void *buf );
+ xbInt16 ReadBlock ( xbUInt32 ulBlockNo, xbUInt32 ulBlockSize, size_t readSize, void *buf );
- xbInt16 ReadBlock ( xbUInt32 ulBlockNo, size_t readSize, void *buf );
- xbInt16 ReadBlock ( xbUInt32 ulBlockNo, xbUInt32 ulBlockSize, size_t readSize, void *buf );
- xbInt16 WriteBlock( xbUInt32 ulBlockNo, size_t writeSize, void *buf );
-
- xbInt16 GetFileSize( xbUInt64 &ullFileSize );
- xbInt16 GetFileMtime( time_t &mtime );
-
- xbDouble eGetDouble( const char *p ) const;
- xbInt32 eGetInt32 ( const char *p ) const;
- xbUInt32 eGetUInt32( const char *p ) const;
- xbInt16 eGetInt16 ( const char *p ) const;
- xbUInt16 eGetUInt16( const char *p ) const;
- void ePutDouble( char *p, xbDouble d );
- void ePutInt32 ( char *p, xbInt32 l );
- void ePutUInt32( char *p, xbUInt32 ul );
- void ePutInt16 ( char *p, xbInt16 s );
- void ePutUInt16( char *p, xbUInt16 s );
-
- xbInt16 xbFclose ();
- xbInt16 xbFeof ();
- xbInt16 xbFflush ();
- xbInt16 xbFgetc ( xbInt32 &c );
- xbInt16 xbFgetc ( char &c );
+ xbInt16 SetBlockSize ( xbUInt32 ulBlockSize );
+ void SetDirectory ( const xbString &sDirectory);
+ void SetFileName ( const xbString &sFileName );
+ void SetFqFileName ( const xbString &sFqName );
+ xbInt16 SetHomeFolders();
- #ifdef XB_LOCKING_SUPPORT
- xbInt16 xbLock ( xbInt16 iFunction, xbInt64 llOffset, size_t stLen );
- xbInt16 GetLockRetryCount() const;
- void SetLockRetryCount( xbInt16 iLockRetries );
- #endif
+ xbInt16 WriteBlock ( xbUInt32 ulBlockNo, size_t writeSize, void *buf );
- xbInt16 xbFopen ( xbInt16 iOpenMode );
- xbInt16 xbFopen ( const xbString &sOpenMode, xbInt16 iShareMode );
- xbInt16 xbFopen ( xbInt16 iOpenMode, xbInt16 iShareMode );
- xbInt16 xbFopen ( const xbString &sMode, const xbString &sFileName, xbInt16 iShareMode );
+ xbInt16 xbFclose ();
+ xbInt16 xbFeof ();
+ xbInt16 xbFflush ();
+ xbInt16 xbFgetc ( xbInt32 &c );
+ xbInt16 xbFgetc ( char &c );
+ xbInt16 xbFgets ( size_t lSize, xbString &sLine );
- xbInt16 xbFputc ( xbInt32 c );
- xbInt16 xbFputc ( xbInt32 c, xbInt32 iNoTimes );
- xbInt16 xbFputs ( const xbString &s );
- xbInt16 xbFread ( void *ptr, size_t size, size_t nmemb );
- xbInt16 xbFgets ( size_t lSize, xbString &sLine );
- size_t xbFtell ();
- xbInt16 xbFseek ( xbInt64 llOffset, xbInt32 whence );
+ xbInt16 xbFopen ( xbInt16 iOpenMode );
+ xbInt16 xbFopen ( const xbString &sOpenMode, xbInt16 iShareMode );
+ xbInt16 xbFopen ( xbInt16 iOpenMode, xbInt16 iShareMode );
+ xbInt16 xbFopen ( const xbString &sMode, const xbString &sFileName, xbInt16 iShareMode );
+ xbInt16 xbFputc ( xbInt32 c );
+ xbInt16 xbFputc ( xbInt32 c, xbInt32 iNoTimes );
+ xbInt16 xbFputs ( const xbString &s );
+ xbInt16 xbFread ( void *ptr, size_t size, size_t nmemb );
+ xbInt16 xbFseek ( xbInt64 llOffset, xbInt32 whence );
+ size_t xbFtell ();
void xbFTurnOffFileBuffering();
- xbInt16 xbFwrite ( const void *ptr, size_t lSize, size_t lNmemb );
+
+ xbInt16 xbReadUntil ( const char cDelim, xbString &sOut );
+ xbInt16 xbRemove ( const xbString &sFileName, xbInt16 iOption );
+ xbInt16 xbRemove ( const xbString &sFileName );
+ xbInt16 xbRemove ();
- xbInt16 xbReadUntil ( const char cDelim, xbString &sOut );
- xbInt16 xbRemove ( const xbString &sFileName, xbInt16 iOption );
- xbInt16 xbRemove ( const xbString &sFileName );
- xbInt16 xbRemove ();
+ xbInt16 xbRename ( const xbString &sOldName, const xbString &sNewName );
+ void xbRewind ();
- xbInt16 xbRename ( const xbString &sOldName, const xbString &sNewName );
- void xbRewind ();
+ xbInt16 xbFwrite ( const void *ptr, size_t lSize, size_t lNmemb );
- xbInt16 xbTruncate ( xbInt64 llSize );
- xbInt16 NameSuffixMissing( const xbString &sFileName, xbInt16 iOption ) const;
+ xbInt16 xbTruncate ( xbInt64 llSize );
+
+
+ #ifdef XB_LOCKING_SUPPORT
+ xbInt16 xbLock ( xbInt16 iFunction, xbInt64 llOffset, size_t stLen );
+ xbInt16 GetLockRetryCount() const;
+ void SetLockRetryCount( xbInt16 iLockRetries );
+ #endif
#ifdef XB_DEBUG_SUPPORT
xbInt16 DumpBlockToDisk( xbUInt32 ulBlockNo, size_t lBlockSize );