Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

FileName Class Reference

#include <FileName.h>

Collaboration diagram for FileName:

List of all members.


Public Members

 FileName ()
FileName& SetPath (StrConst path)
Set by the full pathname.

FileName& SetRelPath (StrConst path)
Set by relative path. More...

String GetPath () const
Get the full pathname.

StrConst GetFile () const
Get the name of the file.

StrConst GetExtension () const
Get the file's current extension.

StrConst GetDir () const
Get the pathname of the parent directory of the file.

FileName& SetFile (StrConst file)
Set the file's name.

FileName& SetExtension (StrConst ext)
Set the file's extension.

FileName& SetDir (StrConst dir)
Set the file's parent directory.

Void AddExtension (StrConst ext)
The current extension is added to the name, and 'ext' becomes the new file extension.

Void RemoveExtension ()
Strips the current extension, and replaces it with the previous extension, if one exists.

Bool Exists () const
Does the file exist?

Bool IsReadable () const
Is it readable?

Bool IsWritable () const
Is it writable?

Long GetTimeStamp () const
Return file's timestamp.

FILE* FOpen (StrConst permissions) const
Return filehandle to the file.

Int FindFileExtension (StrConst extensions[], Bool allowCompressed = true)
Search for file with the given list of acceptable extensions. More...

FileName& MakeUnique ()
Make the filename unique. More...

Int DecompressSetup ()
Set up for decompression.

Void DecompressCleanup ()
Clean up after decompression.

Void AddCompExt ()
Add compression extension to filename.

Flags32 flags
file info.


Protected Members

String path
full path to the parent directory.

String name
current file name.

String extension
file's extension.


Detailed Description

Definition at line 17 of file FileName.h.


Constructor & Destructor Documentation

FileName::FileName ()

Definition at line 21 of file FileName.h.


Member Function Documentation

Void FileName::AddCompExt ()

Add compression extension to filename.

Definition at line 275 of file FileName.cc.

Void FileName::AddExtension (StrConst ext)

The current extension is added to the name, and 'ext' becomes the new file extension.

Definition at line 33 of file FileName.cc.

Void FileName::DecompressCleanup ()

Clean up after decompression.

Definition at line 312 of file FileName.cc.

Int FileName::DecompressSetup ()

Set up for decompression.

Definition at line 285 of file FileName.cc.

Bool FileName::Exists () const

Does the file exist?

Definition at line 102 of file FileName.cc.

FILE * FileName::FOpen (StrConst permissions) const [inline]

Return filehandle to the file.

Definition at line 67 of file FileName.h.

Int FileName::FindFileExtension (StrConst extensions[], Bool allowCompressed = true)

Search for file with the given list of acceptable extensions.

Checks for a file with one of the given set of extensions. The filename should have been already set to:

- The base name, in which case is will check for existing files with one of the extensions.

If allowCompressed is true, it will also recognize (and remove) .gz, .bz2 and .Z extensions, setting flags appropriately.

Returns: kFileNotFound couldn't find a valid file. kBadExtension the extension already set isn't allowable.

Definition at line 145 of file FileName.cc.

StrConst FileName::GetDir () const [inline]

Get the pathname of the parent directory of the file.

Definition at line 41 of file FileName.h.

StrConst FileName::GetExtension () const [inline]

Get the file's current extension.

Definition at line 38 of file FileName.h.

StrConst FileName::GetFile () const [inline]

Get the name of the file.

Definition at line 35 of file FileName.h.

String FileName::GetPath () const

Get the full pathname.

Definition at line 39 of file FileName.cc.

Long FileName::GetTimeStamp () const

Return file's timestamp.

Definition at line 117 of file FileName.cc.

Bool FileName::IsReadable () const

Is it readable?

Definition at line 107 of file FileName.cc.

Bool FileName::IsWritable () const

Is it writable?

Definition at line 112 of file FileName.cc.

FileName & FileName::MakeUnique ()

Make the filename unique.

If a file of the current name already exists, it is renamed 'myname-1.ext'. If that exists, it is renamed 'myname-2.ext', and so on until a file with that name doesn't already exist

Definition at line 257 of file FileName.cc.

Void FileName::RemoveExtension ()

Strips the current extension, and replaces it with the previous extension, if one exists.

Definition at line 18 of file FileName.cc.

FileName & FileName::SetDir (StrConst dir) [inline]

Set the file's parent directory.

Definition at line 51 of file FileName.h.

FileName & FileName::SetExtension (StrConst ext) [inline]

Set the file's extension.

Definition at line 48 of file FileName.h.

FileName & FileName::SetFile (StrConst file) [inline]

Set the file's name.

Definition at line 45 of file FileName.h.

FileName & FileName::SetPath (StrConst path)

Set by the full pathname.

Definition at line 55 of file FileName.cc.

FileName & FileName::SetRelPath (StrConst path)

Set by relative path.

If the path starts with '/', the effect is the same as with SetPath, otherwise the path is appended to the current directory path.

Definition at line 78 of file FileName.cc.


Member Data Documentation

String FileName::extension [protected]

file's extension.

Definition at line 94 of file FileName.h.

Flags32 FileName::flags

file info.

Definition at line 89 of file FileName.h.

String FileName::name [protected]

current file name.

Definition at line 93 of file FileName.h.

String FileName::path [protected]

full path to the parent directory.

Definition at line 92 of file FileName.h.


The documentation for this class was generated from the following files:
Generated at Sat Aug 5 00:16:33 2000 for Class Library by doxygen 1.1.0 written by Dimitri van Heesch, © 1997-2000