Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

SLFile Class Reference
[segusoland C++ Library]

This class is used as a container for file names. More...

#include <SLFile.hpp>

Inheritance diagram for SLFile:

Inheritance graph
[legend]
Collaboration diagram for SLFile:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SLFile (const char *path)
 SLFile (const char *directory, const char *file)
const SLStringgetShortName () const
const SLFileExtgetExt () const
const char * getOSDependantPath () const
const char * getOSDependantName () const
const char * getOSDependantParent () const
Timestamp getTimestamp () const throw (SLFile::IOException)
bool hasExt (const SLFileExt &ext) const

Protected Attributes

boost::shared_ptr< Data > _shared_ptr

Detailed Description

This class is used as a container for file names.

Author:
Alexandre Sauve
The name is stored in the OS dependant format, and the function SLFile::getShortName() is used to get the UTF8 version that will be displayed in the GUI.

SLFile uses shared_ptr, see the Library section for details.


Constructor & Destructor Documentation

SLFile::SLFile const char *  path  ) 
 

The file is constructed from its path. The path string is the OS dependant value, not UTF8.

Parameters:
path is the path (absolute or relative) to the file including the file name.

SLFile::SLFile const char *  directory,
const char *  file
 

The file is constructed from its path and its name separately

Parameters:
directory is the parent directory of the file (without the leading '/')
file is the file name without its path.


Member Function Documentation

const SLFileExt& SLFile::getExt  )  const
 

Returns the Extention of this file.

const char* SLFile::getOSDependantName  )  const
 

Return the file name without path.

const char* SLFile::getOSDependantParent  )  const
 

Gets the parent directory of this file.

example :

SLFile f("/usr/local/bin/test"); f.getOSDependantParent(); // => "/usr/local/bin"

const char* SLFile::getOSDependantPath  )  const
 

Return the full path in the OS dependant encoding.

const SLString& SLFile::getShortName  )  const
 

Gets the name of the file without the whole path. This method is intended to be usefull for the GUI listings.

Returns:
the file name in SLString format (not usable for OS dependant file access).

Timestamp SLFile::getTimestamp  )  const throw (SLFile::IOException)
 

Gets the date of last modification. This value is always up to date (no caching).

Returns:
a Timestamp result.

bool SLFile::hasExt const SLFileExt ext  )  const
 

Return true if the file has the extention specified.


Member Data Documentation

boost::shared_ptr<Data> SLFile::_shared_ptr [protected]
 

Used to store data.


The documentation for this class was generated from the following file:
Generated on Mon Apr 19 01:03:35 2004 for segusoLand by doxygen 1.3.6-20040222