zeus::TFile Class Reference

#include <File.h>

Inheritance diagram for zeus::TFile:

zeus::TZObject zeus::IZUnknown zeus::TPropertyFile zeus::TXMLFile zeus::TZipFile

List of all members.

Public Member Functions

 TFile (const IString &rAbsName)
 TFile (const TDirectoryItem &rItem)
 TFile (TString strAbsName)
 TFile (const IString &rFileRootPath, const IString &rFileName)
 TFile (const TFile &rFile)
virtual ~TFile ()
TString getAbsoluteName () const
TString extractFileName () const
TString extractFileExt () const
TString extractFileNameBase () const
TString extractFilePath () const
bool deleteFile (bool bForce=false)
bool canWrite () const
bool canRead () const
bool exists () const
bool equals (const TFile &rFile) const
bool equals (const IString &rFileName) const
Int64 getSize () const
Timeval getCreationTime () const
Timeval getLastAccessTime () const
Timeval getModificationTime () const
bool copyTo (const IString &rTargetName) const
bool setReadOnly (bool bValue)
void createBackupFiles (Uint uiBackupNum)
bool refresh ()
void splitPath (IString &rDrive, IString &rDirectory, IString &rFileName, IString &rExtension)
TString getFileVersion () const
TString getFileInformation (const IString &rEntryName) const
TString toString () const
TFileoperator= (const TFile &rFile)
bool operator== (const TFile &rFile) const
bool operator== (const TString &rFile) const
bool operator!= (const TFile &rFile) const
bool operator!= (const TString &rFile) const

Static Public Member Functions

static bool isFile (const IString &rDirectoryItem)
static bool isDirectory (const IString &rDirectoryItem)
static bool isHidden (const IString &rDirectoryItem)
static TString createAbsoluteFileNamePath (const IString &rFileName, const IString &rPathToComplete)

Protected Attributes

TString m_strAbsName
 Absolute name.


Detailed Description

The directory class implements methods to access the system directory

Constructor & Destructor Documentation

TFile::TFile ( const IString rAbsName  ) 

Creates an new file wrapper object

Parameters:
rAbsName : Name of the file

TFile::TFile ( const TDirectoryItem rItem  ) 

Creates a file wrapper out of a directory item

Parameters:
rItem : Item containing the informations

TFile::TFile ( TString  strAbsName  ) 

Creates an new file wrapper object

Parameters:
strAbsName : Name of the file

TFile::TFile ( const IString rFileRootPath,
const IString rFileName 
)

Creates a file wrapper out of a root directory and a file name (path)

Parameters:
rFileRootPath : Root directory. Note that the path should end with '/' or '\' separator
rFileName : File name (path). Leading '/' or '\' will be ignored

TFile::TFile ( const TFile rFile  ) 

Copy constructor

TFile::~TFile (  )  [virtual]

Destroys the Directory wrapper object


Member Function Documentation

TString zeus::TFile::getAbsoluteName (  )  const [inline]

Returns the absolute name of the directory

TString TFile::extractFileName (  )  const

This method is used to extract the filename out of the whole path

TString TFile::extractFileExt (  )  const

This method is used to extract the file extentsion out of the whole path

TString TFile::extractFileNameBase (  )  const

This method is used to extract the file base name out of the whole path

TString TFile::extractFilePath (  )  const

This method is used to extract the path of the file

bool TFile::deleteFile ( bool  bForce = false  ) 

Deletes the file

Return values:
true : File deleted
false,: could not delete file

bool TFile::canWrite (  )  const

Checks if the file can be written

Return values:
true : Able to write file
false,: Unable to write file
Todo:
This method is not unicode compatible for Unix systems

bool TFile::canRead (  )  const

Checks if the file can be read

Return values:
true : Able to read file
false,: Unable to read file
Todo:
This method is not unicode compatible for Unix systems

bool TFile::exists (  )  const

Checks if the file exists

Return values:
true : File exists
false : File doesnt exist
Todo:
This method is not unicode compatible for Unix systems

bool zeus::TFile::equals ( const TFile rFile  )  const [inline]

Checks if the two files are equal. This method does only a path check and not a content check.

Parameters:
rFile : Path to check
Return values:
true : Path is equal
false,: Path is not equal

bool TFile::equals ( const IString rFileName  )  const

Checks if the two files are equal

See also:
TFile::equals

Int64 TFile::getSize (  )  const

Reads the size of the file

Returns:
File size in bytes

Timeval TFile::getCreationTime (  )  const

Returns the time of the file creation

Returns:
time

Timeval TFile::getLastAccessTime (  )  const

Returns the time of the last access

Returns:
time

Timeval TFile::getModificationTime (  )  const

Returns the time of the last change

Returns:
time

bool TFile::copyTo ( const IString rTargetName  )  const

Copies the file and renames it

Parameters:
rTargetName : Name of the copied file
Return values:
true : File deleted
false,: could not delete file

bool TFile::setReadOnly ( bool  bValue  ) 

sets or clears the readonly mode

Parameters:
bValue : true = set to readonly; false= set to writable
Return values:
true : Mode successfully set
false,: Setting mode failed
Todo:
This method is not unicode compatible for Unix systems

void TFile::createBackupFiles ( Uint  uiBackupNum  ) 

Creates the backup

Parameters:
uiBackupNum : Max number of backups. The first backup will be called <name>~1.<ext>.

bool TFile::refresh (  ) 

Refreshes the status of the file object

Return values:
true : Status read
false : Could not read status
Todo:
This method is not unicode compatible for Unix systems

void TFile::splitPath ( IString rDrive,
IString rDirectory,
IString rFileName,
IString rExtension 
)

This method splits into a drive (windows only), directory name, file name and file extension

Todo:
This method is not unicode compatible for Unix systems

TString zeus::TFile::getFileVersion (  )  const [inline]

Returns the version of the file. This works only for win32 platforms or platforms supporting resource data of files

TString TFile::getFileInformation ( const IString rEntryName  )  const

Returns a resource data of the file depending on the EntryName This works only for win32 platforms or platforms supporting resource data of files.

Parameters:
rEntryName : Name of the resource data
Returns:
Data

TString zeus::TFile::toString (  )  const [inline]

See also:
TZObject::toString

Reimplemented from zeus::TZObject.

TFile & TFile::operator= ( const TFile rFile  ) 

Copy operator

Parameters:
rFile : File to copy

bool zeus::TFile::operator== ( const TFile rFile  )  const [inline]

Checks if two files are equal

bool zeus::TFile::operator== ( const TString rFile  )  const [inline]

Checks if two files are equal

bool zeus::TFile::operator!= ( const TFile rFile  )  const [inline]

Checks if two files are equal

bool zeus::TFile::operator!= ( const TString rFile  )  const [inline]

Checks if two files are equal

bool zeus::TFile::isFile ( const IString rDirectoryItem  )  [inline, static]

Checks if a directory item is a file

Parameters:
rDirectoryItem : Name of the directory item

bool TFile::isDirectory ( const IString rDirectoryItem  )  [static]

Checks if a directory item is a directory

Parameters:
rDirectoryItem : Name of the directory item

bool TFile::isHidden ( const IString rDirectoryItem  )  [static]

Checks if a directory item is hidden

Parameters:
rDirectoryItem : Name of the directory item

TString TFile::createAbsoluteFileNamePath ( const IString rFileName,
const IString rPathToComplete 
) [static]

creates a complete file name (absolute path)


Member Data Documentation

Absolute name.


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


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Wed Oct 28 21:42:34 2009