TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
iFileBase Struct Referenceabstract
Inheritance diagram for iFileBase:
iUnknown

Detailed Description

Base file interface.

Public Member Functions

virtual tFileFlags GetFileFlags () const =0
 Get the file flags. {Property}. More...
 
virtual const acharGetSourcePath () const =0
 Get the path from where this file has been opened. More...
 
virtual tBool Seek (tI64 offset)=0
 Moves the file pointer from the current position. More...
 
virtual tBool SeekSet (tI64 offset)=0
 Set the file pointer position from the begining of the file. More...
 
virtual tSize ReadRaw (void *apOut, tSize anSize)=0
 Read data from the file. More...
 
virtual tSize WriteRaw (const void *apIn, tSize anSize)=0
 Write data in the file. More...
 
virtual tI64 Tell ()=0
 Tell the current cursor position in the file in bytes. More...
 
virtual tI64 GetSize () const =0
 Get the size of the file. More...
 
virtual tBool SeekEnd (tI64 offset)=0
 Moves the file pointer from the end of the file. More...
 
virtual tBool Flush ()=0
 Flush the file content. More...
 
virtual tBool GetTime (eFileTime aFileTime, iTime *apTime) const =0
 Get the file time. More...
 
virtual tBool SetTime (eFileTime aFileTime, const iTime *apTime)=0
 Set the file time. More...
 
virtual tBool Resize (tI64 newSize)=0
 Resize the file. More...
 
- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual tFileFlags GetFileFlags ( ) const
pure virtual

Get the file flags. {Property}.

virtual const achar* GetSourcePath ( ) const
pure virtual

Get the path from where this file has been opened.

Returns
the path from where this file has been opened. If it has not been opened from a file, by example it's a system memory file, return NULL. {Property}
virtual tBool Seek ( tI64  offset)
pure virtual

Moves the file pointer from the current position.

Parameters
offsetis the number of bytes to add to the current position.
Returns
eTrue if successful, else eFalse.
virtual tBool SeekSet ( tI64  offset)
pure virtual

Set the file pointer position from the begining of the file.

Parameters
offsetis the position, in bytes, from the begining of the file.
Returns
eTrue if successful, else eFalse.
virtual tSize ReadRaw ( void apOut,
tSize  anSize 
)
pure virtual

Read data from the file.

Parameters
apOutis the buffer where the data will be copied.
anSizeis the number of bytes to read from the file.
Returns
the number of bytes really read.
virtual tSize WriteRaw ( const void apIn,
tSize  anSize 
)
pure virtual

Write data in the file.

Parameters
apInis the source buffer which contain the data to write.
anSizeis the number of bytes to write in the file. Usually the size of the pIn buffer.
Returns
the number of bytes really written.
virtual tI64 Tell ( )
pure virtual

Tell the current cursor position in the file in bytes.

virtual tI64 GetSize ( ) const
pure virtual

Get the size of the file.

Returns
the size of the file.
Remarks
If the file is write only, this method can return (0). {Property}
virtual tBool SeekEnd ( tI64  offset)
pure virtual

Moves the file pointer from the end of the file.

Parameters
offsetis the number of bytes to move from the end of the file. By example if you pass 4, the cursor will be passed four bytes before the end of the file.
Returns
eTrue if successful, else eFalse.
virtual tBool Flush ( )
pure virtual

Flush the file content.

virtual tBool GetTime ( eFileTime  aFileTime,
iTime apTime 
) const
pure virtual

Get the file time.

virtual tBool SetTime ( eFileTime  aFileTime,
const iTime apTime 
)
pure virtual

Set the file time.

virtual tBool Resize ( tI64  newSize)
pure virtual

Resize the file.