Ceylan::System::LibfatDirectory Class Reference

Encapsulates libfat directories, as provided by usual operating systems. More...

#include <CeylanLibfatDirectory.h>

Inheritance diagram for Ceylan::System::LibfatDirectory:

Inheritance graph
[legend]
Collaboration diagram for Ceylan::System::LibfatDirectory:

Collaboration graph
[legend]

List of all members.

Public Types

enum  TextOutputFormat { rawText, html }
 Defines what text output formats for TextDisplayable instances are available. More...

Public Member Functions

virtual ~LibfatDirectory () throw ()
 Destroys the directory reference, not the directory itself.
virtual bool hasDirectory (const std::string &subdirectoryName) const
 Tells whether the directory has a direct subdirectory named subdirectoryName.
virtual bool hasFile (const std::string &fileName) const
 Tells whether the directory has a direct file or symbolic link named fileName.
virtual bool hasEntry (const std::string &entryName) const
 Tells whether the directory has a direct entry named entryName, whatever the entry is (file, directory, named FIFO, socket, etc.
virtual void getSubdirectories (std::list< std::string > &subDirectories) const
 Returns the names of all direct subdirectories of this directory, in the specified list.
virtual void getFiles (std::list< std::string > &files) const
 Returns the names of all regular files and symbolic links of this directory, in the specified list.
virtual void getEntries (std::list< std::string > &entries) const
 Returns the names of all direct entries of any type of this directory (including files and directories), in the specified list.
virtual void getSortedEntries (std::list< std::string > &subDirectories, std::list< std::string > &files, std::list< std::string > &otherEntries) const
 Returns the names of all direct entries of any type of this directory (including files and directories), in the corresponding specified list.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const
 Returns a user-friendly description of the state of this object.
 LibfatDirectory (const std::string &directoryName="", bool create=true)
 Creates a LibfatDirectory reference on a directory either already existing, or to be created on disk thanks to the operating system facilities.
virtual void goDown (const std::string &subdirectoryName)
virtual bool isValid () const
 Tells whether the reference on the directory is valid.
virtual const std::string & getPath () const
 Returns the path of the directory which is referred to.
virtual void removeLeadingSeparator ()
 Removes the leading separator, if any, in the path of this directory path.

Static Public Member Functions

static LibfatDirectoryCreate (const std::string &newDirectoryName)
 Returns a LibfatDirectory reference on a directory newly created on disk, thanks to the operating system facilities.
static LibfatDirectoryOpen (const std::string &directoryName="")
 Returns a LibfatDirectory reference on specified already-existing directory, which will be "opened" (i.e.
static bool Exists (const std::string &directoryPath)
 Tells whether the directory directoryPath exists and is a directory indeed.
static void Remove (const std::string &directoryPath, bool recursive=false)
 Removes the directory from disk.
static void Move (const std::string &sourceDirectoryname, const std::string &targetDirectoryname)
 Moves specified directory on filesystem.
static void Copy (const std::string &sourceDirectoryname, const std::string &targetDirectoryname)
 Copies the directory on filesystem.
static time_t GetLastChangeTime (const std::string &directoryPath)
 Returns the last change time of the specified directory.
static bool IsAValidDirectoryPath (const std::string &directoryString)
 Returns whether specified string is a valid directory path.
static void RemoveLeadingSeparator (std::string &path)
 Removes the leading separator, if any, in specified directory's path.
static bool IsAbsolutePath (const std::string &path)
 Tells whether specified path is an absolute path.
static std::string GetCurrentWorkingDirectoryPath ()
 Returns the current working directory name.
static void ChangeWorkingDirectory (const std::string &newWorkingDirectory)
 Changes current working directory to newWorkingDirectory.
static std::list< std::string > SplitPath (const std::string &path)
static std::string JoinPath (const std::list< std::string > &pathElements)
static std::string JoinPath (const std::string &firstPath, const std::string &secondPath)
static void StripFilename (const std::string &path, std::string *base, std::string *file=0)
 Separates the full pathname path into a basename base and file name file.
static Ceylan::Latin1Char GetSeparator ()
static std::string GetSeparatorAsString ()
static const std::string ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high)
 Returns a user-friendly description of this list of pointers to text displayable instances.
static TextOutputFormat GetOutputFormat ()
 Returns the current overall text format to be used by TextDisplayable instances.
static void SetOutputFormat (TextOutputFormat newOutputFormat)
 Sets the current overall text format to be used by TextDisplayable instances.

Protected Member Functions

virtual FileSystemManagergetCorrespondingFileSystemManager () const
 Returns the libfat filesystem manager.
virtual void secureCorrespondingFileSystemManager () const
 Ensures that the libfat filesystem manager is actually available, by instanciating it if necessary.

Static Protected Member Functions

static FileSystemManagerGetCorrespondingFileSystemManager ()
 Returns the filesystem manager that should be used by Directory static methods, which is the default manager.

Protected Attributes

std::string _path
 The path a directory instance refers to.

Static Protected Attributes

static const std::string RootDirectoryPrefix
static const std::string CurrentDirectoryAlias
static const std::string UpperDirectoryAlias
static const char Separator
static TextOutputFormat _OutputFormat = rawText
 The text format to be used currently by TextDisplayable instances.

Private Member Functions

 LibfatDirectory (const LibfatDirectory &source)
 Copy constructor made private to ensure that it will be never called.
LibfatDirectoryoperator= (const LibfatDirectory &source)
 Assignment operator made private to ensure that it will be never called.


Detailed Description

Encapsulates libfat directories, as provided by usual operating systems.

Actual directories should be created and opened with respectively the Directory::Create and Directory::Open factories, that allow the user program to be cross-platform by hiding each filesystem-related per-platform specificity.

See also:
File, FileSystemManager for other file-related operations.

Definition at line 71 of file CeylanLibfatDirectory.h.


Member Enumeration Documentation

Defines what text output formats for TextDisplayable instances are available.

Enumerator:
rawText 
html 

Definition at line 124 of file CeylanTextDisplayable.h.


Constructor & Destructor Documentation

LibfatDirectory::~LibfatDirectory (  )  throw () [virtual]

Destroys the directory reference, not the directory itself.

See also:
Directory::Remove
The destructor must be public as instances created by factories have to be deallocated by the user.

Definition at line 102 of file CeylanLibfatDirectory.cc.

LibfatDirectory::LibfatDirectory ( const std::string &  directoryName = "",
bool  create = true 
) [explicit]

Creates a LibfatDirectory reference on a directory either already existing, or to be created on disk thanks to the operating system facilities.

Parameters:
directoryName the name of the directory to create. If this string is empty, then the current directory of the process will be retained.
This is a LibfatDirectory helper constructor, user code should rely on the higher level and cross-platform factories, Directory::Create and Directory::Open instead.

Exceptions:
DirectoryException,including DirectoryCreationFailed if the operation failed or is not supported on this platform, or DirectoryDelegatingException if the relevant filesystem manager could not be retrieved.

Definition at line 520 of file CeylanLibfatDirectory.cc.

References Ceylan::System::Directory::_path, CEYLAN_LOG, Ceylan::System::FileSystemManager::existsAsDirectory(), Ceylan::System::explainError(), getCorrespondingFileSystemManager(), Ceylan::System::FileSystemManager::getCurrentWorkingDirectoryPath(), Ceylan::System::FileSystemManager::getRootDirectoryPrefix(), Ceylan::System::FileSystemManager::getSeparatorAsString(), Ceylan::System::FileSystemManager::isAbsolutePath(), Ceylan::System::Directory::isValid(), Ceylan::System::FileSystemManager::joinPath(), dataUtils::path, Ceylan::System::Directory::removeLeadingSeparator(), and Ceylan::System::FileSystemManager::splitPath().

Referenced by Create(), and Open().

Ceylan::System::LibfatDirectory::LibfatDirectory ( const LibfatDirectory source  )  [private]

Copy constructor made private to ensure that it will be never called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

void Directory::ChangeWorkingDirectory ( const std::string &  newWorkingDirectory  )  [static, inherited]

Changes current working directory to newWorkingDirectory.

Parameters:
newWorkingDirectory the target working directory.
Exceptions:
DirectoryException if the operation failed or is not supported on this platform. This includes throwing a more specific DirectoryDelegatingException (a child class of DirectoryException), should the underlying filesystem manager not be retrieved as expected.

Definition at line 184 of file CeylanDirectory.cc.

References Ceylan::System::FileSystemManager::changeWorkingDirectory(), and Ceylan::System::Directory::GetCorrespondingFileSystemManager().

Referenced by Ceylan::System::Process::Restart().

void Directory::Copy ( const std::string &  sourceDirectoryname,
const std::string &  targetDirectoryname 
) [static, inherited]

Copies the directory on filesystem.

Parameters:
sourceDirectoryname the path of the directory to be copied.
targetDirectoryname the path of the target directory.
Exceptions:
DirectoryException,including DirectoryCopyFailed if the operation failed or is not supported on this platform, or DirectoryDelegatingException should the underlying filesystem manager not be retrieved as expected.

Definition at line 114 of file CeylanDirectory.cc.

References Ceylan::System::FileSystemManager::copyDirectory(), and Ceylan::System::Directory::GetCorrespondingFileSystemManager().

LibfatDirectory & LibfatDirectory::Create ( const std::string &  newDirectoryName  )  [static]

Returns a LibfatDirectory reference on a directory newly created on disk, thanks to the operating system facilities.

Parameters:
newDirectoryName the name of the directory to create.
This is a LibfatDirectory helper factory, user code should rely on the higher level and cross-platform Directory::Create instead.

Exceptions:
DirectoryException,including DirectoryCreationFailed if the operation failed or is not supported on this platform, or DirectoryDelegatingException if the relevant filesystem manager could not be retrieved.

Reimplemented from Ceylan::System::Directory.

Definition at line 502 of file CeylanLibfatDirectory.cc.

References LibfatDirectory().

Referenced by Ceylan::System::LibfatFileSystemManager::createDirectory().

bool Directory::Exists ( const std::string &  directoryPath  )  [static, inherited]

Tells whether the directory directoryPath exists and is a directory indeed.

Parameters:
directoryPath the directory path to look-up.
Note:
On Windows, files and directories are case-insensitive, and 'c:' is not a directory (it is seen as a drive), whereas 'c:\' is a directory.
Exceptions:
DirectoryException,including DirectoryLookupFailed if the operation failed (existence test failed with no answer) or is not supported on this platform, or DirectoryDelegatingException should the underlying filesystem manager not be retrieved as expected.

Definition at line 80 of file CeylanDirectory.cc.

References Ceylan::System::FileSystemManager::existsAsDirectory(), and Ceylan::System::Directory::GetCorrespondingFileSystemManager().

FileSystemManager & Directory::GetCorrespondingFileSystemManager (  )  [static, protected, inherited]

FileSystemManager & LibfatDirectory::getCorrespondingFileSystemManager (  )  const [protected, virtual]

Returns the libfat filesystem manager.

Note:
It is not necessarily the current default filesystem manager.
Exceptions:
DirectoryDelegatingException if the operation failed.

Implements Ceylan::System::Directory.

Definition at line 634 of file CeylanLibfatDirectory.cc.

References dataUtils::e, Ceylan::System::LibfatFileSystemManager::GetLibfatFileSystemManager(), and Ceylan::Exception::toString().

Referenced by hasDirectory(), hasEntry(), hasFile(), and LibfatDirectory().

string Directory::GetCurrentWorkingDirectoryPath (  )  [static, inherited]

Returns the current working directory name.

Exceptions:
DirectoryException if the operation failed or is not supported on this platform. This includes throwing a more specific DirectoryDelegatingException (a child class of DirectoryException), should the underlying filesystem manager not be retrieved as expected.

Definition at line 173 of file CeylanDirectory.cc.

References Ceylan::System::Directory::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::getCurrentWorkingDirectoryPath().

Referenced by Ceylan::System::Process::SaveState().

void LibfatDirectory::getEntries ( std::list< std::string > &  entries  )  const [virtual]

Returns the names of all direct entries of any type of this directory (including files and directories), in the specified list.

Parameters:
entries the caller-provided list in which entries will be added.
Exceptions:
DirectoryLookupFailed if the operation failed or is not supported.
Note:
Aliases for current and parent directories (ex: '.' and '..') will be filtered out.

Implements Ceylan::System::Directory.

Definition at line 384 of file CeylanLibfatDirectory.cc.

References Ceylan::System::Directory::_path, and PATH_MAX.

Referenced by Ceylan::System::LibfatFileSystemManager::removeDirectory().

void LibfatDirectory::getFiles ( std::list< std::string > &  files  )  const [virtual]

Returns the names of all regular files and symbolic links of this directory, in the specified list.

Parameters:
files the caller-provided list in which regular files and symbolic links will be added.
Exceptions:
DirectoryLookupFailed if the operation failed or is not supported.

Implements Ceylan::System::Directory.

Definition at line 337 of file CeylanLibfatDirectory.cc.

References Ceylan::System::Directory::_path, and PATH_MAX.

time_t Directory::GetLastChangeTime ( const std::string &  directoryPath  )  [static, inherited]

Returns the last change time of the specified directory.

Parameters:
directoryPath the path of the directory whose last change time is searched.
Exceptions:
DirectoryLastChangeTimeRequestFailed if the operation failed or is not supported on this platform, or DirectoryDelegatingException if the relevant filesystem manager could not be retrieved.

Definition at line 126 of file CeylanDirectory.cc.

References Ceylan::System::Directory::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::getLastChangeTimeDirectory().

TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat (  )  [static, inherited]

const std::string & Directory::getPath (  )  const [virtual, inherited]

Returns the path of the directory which is referred to.

Returns:
the path, with no leading separator.

Definition at line 378 of file CeylanDirectory.cc.

References Ceylan::System::Directory::_path.

Referenced by Ceylan::Log::LogAggregatorHTML::aggregate(), and Ceylan::Log::LogAggregatorHTML::write().

Ceylan::Latin1Char Directory::GetSeparator (  )  [static, inherited]

string Directory::GetSeparatorAsString (  )  [static, inherited]

void LibfatDirectory::getSortedEntries ( std::list< std::string > &  subDirectories,
std::list< std::string > &  files,
std::list< std::string > &  otherEntries 
) const [virtual]

Returns the names of all direct entries of any type of this directory (including files and directories), in the corresponding specified list.

Parameters:
subDirectories the caller-provided list in which subDirectories of this directory will be added.
files the caller-provided list in which files of this directory will be added.
otherEntries the caller-provided list in which other entries (named FIFO, sockets, etc.) of this directory will be added.
Exceptions:
DirectoryLookupFailed if the operation failed or is not supported.
Note:
Aliases for current and parent directories (ex: '.' and '..') will be filtered out.

Implements Ceylan::System::Directory.

Definition at line 429 of file CeylanLibfatDirectory.cc.

References Ceylan::System::Directory::_path, and PATH_MAX.

void LibfatDirectory::getSubdirectories ( std::list< std::string > &  subDirectories  )  const [virtual]

Returns the names of all direct subdirectories of this directory, in the specified list.

Parameters:
subDirectories the caller-provided list in which subdirectories will be added.
Exceptions:
DirectoryLookupFailed if the operation failed or is not supported.
Note:
Aliases for current and parent directories (ex: '.' and '..') will be filtered out.

Implements Ceylan::System::Directory.

Definition at line 288 of file CeylanLibfatDirectory.cc.

References Ceylan::System::Directory::_path, and PATH_MAX.

void Directory::goDown ( const std::string &  subdirectoryName  )  [virtual, inherited]

bool LibfatDirectory::hasDirectory ( const std::string &  subdirectoryName  )  const [virtual]

Tells whether the directory has a direct subdirectory named subdirectoryName.

Parameters:
subdirectoryName the name of the directory entry to look-up. Alias for current directory (ex: '.') and parent one (ex: '..') are always deemed existing.
Exceptions:
DirectoryLookupFailed is the operation failed or is not supported.

Implements Ceylan::System::Directory.

Definition at line 124 of file CeylanLibfatDirectory.cc.

References Ceylan::System::Directory::_path, dataUtils::e, Ceylan::System::FileSystemManager::getAliasForCurrentDirectory(), Ceylan::System::FileSystemManager::getAliasForParentDirectory(), getCorrespondingFileSystemManager(), Ceylan::System::FileSystemManager::joinPath(), Ceylan::Exception::toString(), and generalUtils::true.

bool LibfatDirectory::hasEntry ( const std::string &  entryName  )  const [virtual]

Tells whether the directory has a direct entry named entryName, whatever the entry is (file, directory, named FIFO, socket, etc.

), except aliases for current directory (ex: '.') and parent one (ex: '..') that are ignored (false is returned for them).

Parameters:
entryName the name of the entry to look-up.
Exceptions:
DirectoryLookupFailed is the operation failed or is not supported.

Implements Ceylan::System::Directory.

Definition at line 233 of file CeylanLibfatDirectory.cc.

References Ceylan::System::Directory::_path, dataUtils::e, Ceylan::System::FileSystemManager::getAliasForCurrentDirectory(), Ceylan::System::FileSystemManager::getAliasForParentDirectory(), getCorrespondingFileSystemManager(), Ceylan::System::FileSystemManager::joinPath(), Ceylan::Exception::toString(), and generalUtils::true.

bool LibfatDirectory::hasFile ( const std::string &  fileName  )  const [virtual]

Tells whether the directory has a direct file or symbolic link named fileName.

Parameters:
fileName the name of the file to look-up.
Exceptions:
DirectoryLookupFailed is the operation failed or is not supported.

Implements Ceylan::System::Directory.

Definition at line 181 of file CeylanLibfatDirectory.cc.

References Ceylan::System::Directory::_path, dataUtils::e, getCorrespondingFileSystemManager(), Ceylan::System::FileSystemManager::joinPath(), and Ceylan::Exception::toString().

bool Directory::IsAbsolutePath ( const std::string &  path  )  [static, inherited]

Tells whether specified path is an absolute path.

Parameters:
path the path that may be absolute.
Exceptions:
DirectoryException if the operation failed or is not supported on this platform. This includes throwing a more specific DirectoryDelegatingException (a child class of DirectoryException), should the underlying filesystem manager not be retrieved as expected.

Definition at line 163 of file CeylanDirectory.cc.

References Ceylan::System::Directory::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::isAbsolutePath().

bool Directory::IsAValidDirectoryPath ( const std::string &  directoryString  )  [static, inherited]

Returns whether specified string is a valid directory path.

Parameters:
directoryString the directory string.
Note:
If no regular expression support is available, then the name will be deemed always correct.
Exceptions:
DirectoryException if the operation failed or is not supported on this platform. This includes throwing a more specific DirectoryDelegatingException (a child class of DirectoryException), should the underlying filesystem manager not be retrieved as expected.

Definition at line 141 of file CeylanDirectory.cc.

References Ceylan::System::Directory::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::isAValidDirectoryPath().

bool Directory::isValid (  )  const [virtual, inherited]

Tells whether the reference on the directory is valid.

Checks that corresponding path exists, and that it is a directory.

Exceptions:
DirectoryException if the operation failed or is not supported.

Definition at line 364 of file CeylanDirectory.cc.

References Ceylan::System::Directory::_path, Ceylan::System::FileSystemManager::existsAsDirectory(), and Ceylan::System::Directory::getCorrespondingFileSystemManager().

Referenced by LibfatDirectory(), and Ceylan::System::StandardDirectory::StandardDirectory().

string Directory::JoinPath ( const std::string &  firstPath,
const std::string &  secondPath 
) [static, inherited]

string Directory::JoinPath ( const std::list< std::string > &  pathElements  )  [static, inherited]

void Directory::Move ( const std::string &  sourceDirectoryname,
const std::string &  targetDirectoryname 
) [static, inherited]

Moves specified directory on filesystem.

A special case of directory moving is directory renaming.

Parameters:
sourceDirectoryname the path of the directory to be moved.
targetDirectoryname the path of the target directory.
Exceptions:
DirectoryException,including DirectoryMoveFailed if the operation failed or is not supported on this platform, or DirectoryDelegatingException should the underlying filesystem manager not be retrieved as expected.

Definition at line 102 of file CeylanDirectory.cc.

References Ceylan::System::Directory::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::moveDirectory().

LibfatDirectory & LibfatDirectory::Open ( const std::string &  directoryName = ""  )  [static]

Returns a LibfatDirectory reference on specified already-existing directory, which will be "opened" (i.e.

referred to), thanks to the operating system facilities.

Parameters:
directoryName the name of the directory. If not specified (the string is empty), returns a reference to the current working directory.
This is a LibfatDirectory helper factory, user code should rely on the higher level and cross-platform Directory::Open instead.

Exceptions:
DirectoryException,including DirectoryOpeningFailed if the operation failed or is not supported on this platform, or DirectoryDelegatingException if the relevant filesystem manager could not be retrieved.

Reimplemented from Ceylan::System::Directory.

Definition at line 511 of file CeylanLibfatDirectory.cc.

References LibfatDirectory().

Referenced by Ceylan::System::LibfatFileSystemManager::openDirectory(), and Ceylan::System::LibfatFileSystemManager::removeDirectory().

LibfatDirectory& Ceylan::System::LibfatDirectory::operator= ( const LibfatDirectory source  )  [private]

Assignment operator made private to ensure that it will be never called.

The compiler should complain whenever this undefined operator is called, implicitly or not.

void Directory::Remove ( const std::string &  directoryPath,
bool  recursive = false 
) [static, inherited]

Removes the directory from disk.

Parameters:
directoryPath the path of the target directory.
recursive if false, the specified directory is expected to be empty, and it will be removed. If true, then the full directory content (including all files and possible subdirectories) and this directory itself will be removed.
Exceptions:
DirectoryException,including DirectoryRemoveFailed if the operation failed or is not supported on this platform, or DirectoryDelegatingException should the underlying filesystem manager not be retrieved as expected.

Definition at line 91 of file CeylanDirectory.cc.

References Ceylan::System::Directory::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::removeDirectory().

void Directory::removeLeadingSeparator (  )  [virtual, inherited]

Removes the leading separator, if any, in the path of this directory path.

Exceptions:
DirectoryException if the operation failed or is not supported.

Definition at line 387 of file CeylanDirectory.cc.

References Ceylan::System::Directory::_path, Ceylan::System::Directory::getCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::removeLeadingSeparator().

Referenced by LibfatDirectory(), and Ceylan::System::StandardDirectory::StandardDirectory().

void Directory::RemoveLeadingSeparator ( std::string &  path  )  [static, inherited]

Removes the leading separator, if any, in specified directory's path.

Parameters:
path the path that will be modified.
Exceptions:
DirectoryException if the operation failed or is not supported on this platform. This includes throwing a more specific DirectoryDelegatingException (a child class of DirectoryException), should the underlying filesystem manager not be retrieved as expected.

Definition at line 152 of file CeylanDirectory.cc.

References Ceylan::System::Directory::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::removeLeadingSeparator().

void LibfatDirectory::secureCorrespondingFileSystemManager (  )  const [protected, virtual]

Ensures that the libfat filesystem manager is actually available, by instanciating it if necessary.

Note:
It is not necessarily the current default filesystem manager.
Exceptions:
DirectoryDelegatingException if the operation failed.

Definition at line 656 of file CeylanLibfatDirectory.cc.

References dataUtils::e, Ceylan::System::LibfatFileSystemManager::SecureLibfatFileSystemManager(), and Ceylan::Exception::toString().

void TextDisplayable::SetOutputFormat ( TextOutputFormat  newOutputFormat  )  [static, inherited]

Sets the current overall text format to be used by TextDisplayable instances.

Parameters:
newOutputFormat the new output format.

Definition at line 72 of file CeylanTextDisplayable.cc.

References Ceylan::TextDisplayable::_OutputFormat.

Referenced by Ceylan::Log::LogHolder::LogHolder().

list< string > Directory::SplitPath ( const std::string &  path  )  [static, inherited]

void Directory::StripFilename ( const std::string &  path,
std::string *  base,
std::string *  file = 0 
) [static, inherited]

Separates the full pathname path into a basename base and file name file.

For example, this method applied to "/mnt/raid/md0/LOANI-0.3" returns respectively "/mnt/raid/md0" and "LOANI-0.3", when the separator is '/'.

Parameters:
path the path which is to be stripped.
base if non null, must be a pointer to an already allocated string where the basename will be stored. If not interested in the basename, specify a null (0) pointer instead: this method will act as UNIX "basename".
file if non null, must be a pointer to an already allocated string where the filename will be stored. If not interested in the filename, specify a null (0) pointer instead: this method will act as UNIX "dirname".
Exceptions:
DirectoryException if the operation failed or is not supported on this platform. This includes throwing a more specific DirectoryDelegatingException (a child class of DirectoryException), should the underlying filesystem manager not be retrieved as expected.

Definition at line 227 of file CeylanDirectory.cc.

References Ceylan::System::Directory::GetCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::stripFilename().

Referenced by Ceylan::Log::LogPlug::GetSpeakerNameFrom().

const std::string TextDisplayable::ToString ( std::list< TextDisplayable * >  displayables,
Ceylan::VerbosityLevels  level = Ceylan::high 
) [static, inherited]

Returns a user-friendly description of this list of pointers to text displayable instances.

Parameters:
displayables a list of pointers to TextDisplayable instances/
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
toString, Ceylan::VerbosityLevels

Definition at line 45 of file CeylanTextDisplayable.cc.

References Ceylan::formatStringList().

const string LibfatDirectory::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const [virtual]

Returns a user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
TextDisplayable

Reimplemented from Ceylan::System::Directory.

Definition at line 489 of file CeylanLibfatDirectory.cc.

References Ceylan::System::Directory::_path.


Member Data Documentation

TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited]

The text format to be used currently by TextDisplayable instances.

Note:
Defaults to raw text.

Definition at line 158 of file CeylanTextDisplayable.h.

Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().

std::string Ceylan::System::Directory::_path [protected, inherited]

const std::string Ceylan::System::LibfatDirectory::CurrentDirectoryAlias [static, protected]

Definition at line 377 of file CeylanLibfatDirectory.h.

const std::string Ceylan::System::LibfatDirectory::RootDirectoryPrefix [static, protected]

Definition at line 367 of file CeylanLibfatDirectory.h.

const char Ceylan::System::LibfatDirectory::Separator [static, protected]

Definition at line 395 of file CeylanLibfatDirectory.h.

const std::string Ceylan::System::LibfatDirectory::UpperDirectoryAlias [static, protected]

Definition at line 387 of file CeylanLibfatDirectory.h.


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

Generated on Thu Jun 4 20:41:00 2009 for Ceylan by  doxygen 1.5.8