#include <CeylanStandardFileSystemManager.h>
Public Types | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
virtual bool | existsAsEntry (const std::string &entryPath) const |
Tells whether the filesystem entry entryPath exists, be it a file, a symbolic link, a directory, a character or block device, a FIFO, a socket, etc. | |
virtual void | createSymbolicLink (const std::string &linkTarget, const std::string &linkName) |
Creates a symbolic link on filesystem. | |
virtual time_t | getEntryChangeTime (const std::string &entryPath) |
Returns the change time time of the entry entryPath, be it a file, a directory, etc. | |
virtual const std::string & | getRootDirectoryPrefix () const |
virtual Ceylan::Latin1Char | getSeparator () const |
virtual File & | createFile (const std::string &filename, OpeningFlag createFlag=File::CreateToWriteBinary, PermissionFlag permissionFlag=File::OwnerReadWrite) |
Returns a StandardFile reference on a newly created file. | |
virtual File & | openFile (const std::string &filename, OpeningFlag openFlag=File::OpenToReadBinary) |
Returns a File reference on specified already-existing file, which will be opened with specified settings. | |
virtual bool | existsAsFileOrSymbolicLink (const std::string &filename) const |
Tells whether the regular file or symbolic link filename exists (and is not a directory). | |
virtual void | removeFile (const std::string &filename) |
Removes the file or symbolic link from the filesystem. | |
virtual void | moveFile (const std::string &sourceFilename, const std::string &targetFilename) |
Moves the file on filesystem. | |
virtual void | copyFile (const std::string &sourceFilename, const std::string &targetFilename) |
Copies the file on filesystem. | |
virtual Size | getSize (const std::string &filename) |
Returns the size, in bytes, of the specified file. | |
virtual time_t | getLastChangeTimeFile (const std::string &filename) |
Returns the last change time of the specified file. | |
virtual void | touch (const std::string &filename) |
Updates the last access and modification times of specified file. | |
virtual Directory & | createDirectory (const std::string &newDirectoryName) |
Returns a Directory reference on a directory newly created on filesystem. | |
virtual Directory & | openDirectory (const std::string &directoryName="") |
Returns a Directory reference on specified already-existing directory, which will be "opened" (i.e. | |
virtual bool | existsAsDirectory (const std::string &directoryPath) const |
Tells whether the directory directoryPath exists and is a directory indeed. | |
virtual void | removeDirectory (const std::string &directoryPath, bool recursive=false) |
Removes the directory from filesystem. | |
virtual void | moveDirectory (const std::string &sourceDirectoryPath, const std::string &targetDirectoryPath) |
Moves the directory on filesystem. | |
virtual void | copyDirectory (const std::string &sourceDirectoryPath, const std::string &targetDirectoryPath) |
Copies the file on filesystem. | |
virtual time_t | getLastChangeTimeDirectory (const std::string &directoryPath) |
Returns the last change time of the specified directory. | |
virtual bool | isAValidDirectoryPath (const std::string &directoryString) |
Returns whether specified string is a valid directory path. | |
virtual bool | isAbsolutePath (const std::string &path) |
Tells whether specified path is an absolute path. | |
virtual std::string | getCurrentWorkingDirectoryPath () |
Returns the current working directory path. | |
virtual void | changeWorkingDirectory (const std::string &newWorkingDirectory) |
Changes current working directory to newWorkingDirectory. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns a user-friendly description of the state of this object. | |
StandardFileSystemManager () | |
Constructs a reference to a standard filesystem, initializes accordingly any needed subsystem. | |
virtual | ~StandardFileSystemManager () throw () |
Destroys the Ceylan standard filesystem reference, not the filesystem itself. | |
virtual std::string | getSeparatorAsString () const |
virtual const std::string & | getAliasForCurrentDirectory () const |
virtual const std::string & | getAliasForParentDirectory () const |
virtual std::string | transformIntoValidFilename (const std::string &rawFilename) |
Takes specified rawFilename and tries to transform it so that the result should be a valid name, from the filesystem's point of view. | |
virtual bool | diff (const std::string &firstFilename, const std::string &secondFilename) |
Tells whether the two specified files have exactly the same content (byte-wise). | |
virtual void | removeLeadingSeparator (std::string &path) |
Removes the leading separator, if any, in specified directory's path. | |
virtual std::list< std::string > | splitPath (const std::string &path) |
virtual std::string | joinPath (const std::list< std::string > &pathElements) |
virtual std::string | joinPath (const std::string &firstPath, const std::string &secondPath) |
virtual 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 Public Member Functions | |
static StandardFileSystemManager & | GetStandardFileSystemManager () |
Returns a reference to the unique standard filesystem manager. | |
static void | RemoveStandardFileSystemManager () |
Removes the current standard filesystem manager, if any. | |
static FileDescriptor | Duplicate (FileDescriptor fd) |
Duplicates the file descriptor. | |
static bool | ExistsAsEntry (const std::string &entryPath) |
Tells whether the filesystem entry entryPath exists, be it a file, a symbolic link, a directory, a character or block device, a FIFO, a socket, etc. | |
static void | CreateSymbolicLink (const std::string &linkTarget, const std::string &linkName) |
Creates a symbolic link on filesystem. | |
static time_t | GetEntryChangeTime (const std::string &entryPath) |
Returns the change time time of the entry entryPath, be it a file, a directory, etc. | |
static const std::string & | GetRootDirectoryPrefix () |
static Ceylan::Latin1Char | GetSeparator () |
static std::string | GetSeparatorAsString () |
static const std::string & | GetAliasForCurrentDirectory () |
static const std::string & | GetAliasForParentDirectory () |
static bool | IsDefaultFileSystemManagerSet () |
Returns whether the default filesystem manager is set. | |
static void | SetDefaultFileSystemManager (FileSystemManager &newDefaultFileSystemManager, bool deallocatePreviousIfAny=true) |
Sets the default filesystem manager, the one that will be used if no filesystem manager is specified otherwise. | |
static void | SetDefaultFileSystemManagerToPlatformDefault () |
Sets the default filesystem manager to the platform default, i.e. | |
static FileSystemManager & | GetExistingDefaultFileSystemManager () |
Returns a reference to the unique default filesystem manager, that is expected to exist already. | |
static FileSystemManager & | GetAnyDefaultFileSystemManager () |
Returns a reference to the unique default filesystem manager, that is created from platform defaults if needed. | |
static void | RemoveDefaultFileSystemManager () |
Removes the current default filesystem manager, if any. | |
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. | |
Static Protected Attributes | |
static FileSystemManager * | _CurrentDefaultFileSystemManager = 0 |
Pointer to the default filesystem manager (if any). | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
StandardFileSystemManager (const StandardFileSystemManager &source) | |
Copy constructor made private to ensure that it will be never called. | |
StandardFileSystemManager & | operator= (const StandardFileSystemManager &source) |
Assignment operator made private to ensure that it will be never called. | |
Static Private Attributes | |
static const std::string | RootDirectoryPrefix = "" |
static const Ceylan::Latin1Char | Separator = '/' |
static StandardFileSystemManager * | _StandardFileSystemManager = 0 |
Pointer to the current standard filesystem manager (if any). |
Standard (POSIX and all) calls are issued by this class.
Use GetStandardFileSystemManager to retrieve this manager.
Definition at line 78 of file CeylanStandardFileSystemManager.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
StandardFileSystemManager::StandardFileSystemManager | ( | ) |
Constructs a reference to a standard filesystem, initializes accordingly any needed subsystem.
Cannot be private, as has to be subclassed. Cannot be protected, as has to be instanciated by factories from the mother class.
StandardFileSystemManagerException | if the operation failed. |
Definition at line 1224 of file CeylanStandardFileSystemManager.cc.
Referenced by GetStandardFileSystemManager().
StandardFileSystemManager::~StandardFileSystemManager | ( | ) | throw () [virtual] |
Destroys the Ceylan standard filesystem reference, not the filesystem itself.
Cannot be private as has to be subclassed.
Definition at line 1239 of file CeylanStandardFileSystemManager.cc.
References _StandardFileSystemManager.
Ceylan::System::StandardFileSystemManager::StandardFileSystemManager | ( | const StandardFileSystemManager & | 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.
void StandardFileSystemManager::changeWorkingDirectory | ( | const std::string & | newWorkingDirectory | ) | [virtual] |
Changes current working directory to newWorkingDirectory.
newWorkingDirectory | the target working directory. |
DirectoryChangeFailed | if the operation failed or is not supported on the target platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 1138 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::explainError().
void StandardFileSystemManager::copyDirectory | ( | const std::string & | sourceDirectoryPath, | |
const std::string & | targetDirectoryPath | |||
) | [virtual] |
Copies the file on filesystem.
sourceDirectoryPath | the path of the directory to be copied. | |
targetDirectoryPath | the path of the target directory. |
DirectoryCopyFailed | if the operation failed or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 931 of file CeylanStandardFileSystemManager.cc.
Referenced by moveDirectory().
void StandardFileSystemManager::copyFile | ( | const std::string & | sourceFilename, | |
const std::string & | targetFilename | |||
) | [virtual] |
Copies the file on filesystem.
sourceFilename | the filename of the file to be copied. | |
targetFilename | the new filename of the copied file. |
FileCopyFailed | if the operation failed or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 377 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::File::BigBufferSize, Ceylan::System::StandardFile::close(), Ceylan::System::StandardFile::Create(), Ceylan::System::File::CreateToWriteBinary, dataUtils::e, getSize(), Ceylan::System::StandardFile::Open(), Ceylan::System::File::OwnerReadWrite, Ceylan::System::StandardFile::read(), Ceylan::Exception::toString(), and Ceylan::System::StandardFile::write().
Referenced by moveFile().
Directory & StandardFileSystemManager::createDirectory | ( | const std::string & | newDirectoryName | ) | [virtual] |
Returns a Directory reference on a directory newly created on filesystem.
newDirectoryName | the name of the directory to create. |
DirectoryException,including | DirectoryCreationFailed if the directory creation failed. |
Implements Ceylan::System::FileSystemManager.
Definition at line 650 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::StandardDirectory::Create().
File & StandardFileSystemManager::createFile | ( | const std::string & | filename, | |
OpeningFlag | createFlag = File::CreateToWriteBinary , |
|||
PermissionFlag | permissionFlag = File::OwnerReadWrite | |||
) | [virtual] |
Returns a StandardFile reference on a newly created file.
By default, it creates a new file on disk. If the name corresponds to an already-existing file, it will be truncated and overwritten.
filename | the name of the file. | |
createFlag | the flag describing the creation mode. | |
permissionFlag | the flag describing the requested permissions. On platforms that do not manage permissions, this parameter will be ignored. |
FileException,including | FileCreationFailed if the operation failed or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 239 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::StandardFile::Create().
void FileSystemManager::CreateSymbolicLink | ( | const std::string & | linkTarget, | |
const std::string & | linkName | |||
) | [static, inherited] |
Creates a symbolic link on filesystem.
linkTarget | the full path of the entry the new link should point to. | |
linkName | the filename of the link to create. |
FileSystemManagerException,which | includes SymlinkFailed if the creation failed or is not supported, and FileSystemManagerDelegatingException if the underlying specialized FileSystemManager instance could not be retrieved. |
Definition at line 111 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::createSymbolicLink(), and Ceylan::System::FileSystemManager::GetAnyDefaultFileSystemManager().
void StandardFileSystemManager::createSymbolicLink | ( | const std::string & | linkTarget, | |
const std::string & | linkName | |||
) | [virtual] |
Creates a symbolic link on filesystem.
linkTarget | the full path of the entry the new link should point to. | |
linkName | the filename of the link to create. |
SymlinkFailed | if the creation failed, or if the symbolic link feature is not supported. |
Implements Ceylan::System::FileSystemManager.
Definition at line 143 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::explainError().
bool FileSystemManager::diff | ( | const std::string & | firstFilename, | |
const std::string & | secondFilename | |||
) | [virtual, inherited] |
Tells whether the two specified files have exactly the same content (byte-wise).
firstFilename | the filename of the first file to compare. | |
secondFilename | the filename of the second file to compare. |
FileDiffFailed | if the operation failed or is not supported on this platform. |
Definition at line 294 of file CeylanFileSystemManager.cc.
References dataUtils::e, Ceylan::System::FileSystemManager::existsAsFileOrSymbolicLink(), generalUtils::false, first, Ceylan::System::FileSystemManager::getSize(), Ceylan::System::FileSystemManager::openFile(), Ceylan::System::InputStream::readUint8(), Ceylan::Exception::toString(), and generalUtils::true.
Referenced by Ceylan::System::File::Diff().
FileDescriptor StandardFileSystemManager::Duplicate | ( | FileDescriptor | fd | ) | [static] |
Duplicates the file descriptor.
fd | the file descriptor to duplicate. |
DuplicateFailed | if the operation failed or if the file descriptor feature is not available. |
Definition at line 1259 of file CeylanStandardFileSystemManager.cc.
References Ceylan::toString().
Referenced by Ceylan::System::Pipe::Pipe().
bool StandardFileSystemManager::existsAsDirectory | ( | const std::string & | directoryPath | ) | const [virtual] |
Tells whether the directory directoryPath exists and is a directory indeed.
directoryPath | the directory path to look-up. |
DirectoryLookupFailed | if the operation failed (existence test failed with no answer) or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 670 of file CeylanStandardFileSystemManager.cc.
References generalUtils::false, and generalUtils::true.
bool FileSystemManager::ExistsAsEntry | ( | const std::string & | entryPath | ) | [static, inherited] |
Tells whether the filesystem entry entryPath exists, be it a file, a symbolic link, a directory, a character or block device, a FIFO, a socket, etc.
entryPath | the path of the entry to look-up. |
FileSystemManagerException,which | includes EntryLookupFailed if the operation failed or is not supported, and FileSystemManagerDelegatingException if the underlying specialized FileSystemManager instance could not be retrieved. |
Definition at line 101 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::existsAsEntry(), and Ceylan::System::FileSystemManager::GetAnyDefaultFileSystemManager().
bool StandardFileSystemManager::existsAsEntry | ( | const std::string & | entryPath | ) | const [virtual] |
Tells whether the filesystem entry entryPath exists, be it a file, a symbolic link, a directory, a character or block device, a FIFO, a socket, etc.
entryPath | the path of the entry to look-up. |
EntryLookupFailed | if the operation failed (existence test failed with no answer) or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 111 of file CeylanStandardFileSystemManager.cc.
bool StandardFileSystemManager::existsAsFileOrSymbolicLink | ( | const std::string & | filename | ) | const [virtual] |
Tells whether the regular file or symbolic link filename exists (and is not a directory).
filename | the filename to look-up. |
FileLookupFailed | if the operation failed (existence test failed with no answer) or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 259 of file CeylanStandardFileSystemManager.cc.
Referenced by Ceylan::System::StandardFile::ConvertToStreamOpenFlag().
const std::string & FileSystemManager::getAliasForCurrentDirectory | ( | ) | const [virtual, inherited] |
Definition at line 197 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::DefaultAliasForCurrentDirectory.
Referenced by Ceylan::System::FileSystemManager::GetAliasForCurrentDirectory(), Ceylan::System::StandardDirectory::getSortedEntries(), Ceylan::System::StandardDirectory::hasDirectory(), Ceylan::System::LibfatDirectory::hasDirectory(), Ceylan::System::LibfatDirectory::hasEntry(), and Ceylan::System::StandardDirectory::hasFile().
const string & FileSystemManager::GetAliasForCurrentDirectory | ( | ) | [static, inherited] |
Definition at line 167 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::getAliasForCurrentDirectory(), and Ceylan::System::FileSystemManager::GetAnyDefaultFileSystemManager().
const std::string & FileSystemManager::getAliasForParentDirectory | ( | ) | const [virtual, inherited] |
Definition at line 207 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::DefaultAliasForParentDirectory.
Referenced by Ceylan::System::FileSystemManager::GetAliasForParentDirectory(), Ceylan::System::StandardDirectory::getSortedEntries(), Ceylan::System::StandardDirectory::hasDirectory(), Ceylan::System::LibfatDirectory::hasDirectory(), Ceylan::System::LibfatDirectory::hasEntry(), and Ceylan::System::StandardDirectory::hasFile().
const string & FileSystemManager::GetAliasForParentDirectory | ( | ) | [static, inherited] |
Definition at line 177 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::getAliasForParentDirectory(), and Ceylan::System::FileSystemManager::GetAnyDefaultFileSystemManager().
FileSystemManager & FileSystemManager::GetAnyDefaultFileSystemManager | ( | ) | [static, inherited] |
Returns a reference to the unique default filesystem manager, that is created from platform defaults if needed.
Ensures that the unique default filesystem manager is set, creates it if needed, ensures it remains a singleton.
If a manager is already available, returns it. Otherwise, it means the user did not wanted to specify a specific one, hence one is created from platform defaults.
FileSystemManagerException | if the operation failed. |
Definition at line 620 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::_CurrentDefaultFileSystemManager, and Ceylan::System::FileSystemManager::SetDefaultFileSystemManagerToPlatformDefault().
Referenced by Ceylan::System::FileSystemManager::CreateSymbolicLink(), Ceylan::System::FileSystemManager::ExistsAsEntry(), Ceylan::System::FileSystemManager::GetAliasForCurrentDirectory(), Ceylan::System::FileSystemManager::GetAliasForParentDirectory(), Ceylan::System::File::GetCorrespondingFileSystemManager(), Ceylan::System::Directory::GetCorrespondingFileSystemManager(), Ceylan::System::FileSystemManager::GetEntryChangeTime(), Ceylan::System::FileSystemManager::GetRootDirectoryPrefix(), Ceylan::System::FileSystemManager::GetSeparator(), and Ceylan::System::FileSystemManager::GetSeparatorAsString().
std::string StandardFileSystemManager::getCurrentWorkingDirectoryPath | ( | ) | [virtual] |
Returns the current working directory path.
DirectoryGetCurrentFailed | if the operation failed or is not supported on the target platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 1044 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::explainError(), and PATH_MAX.
time_t FileSystemManager::GetEntryChangeTime | ( | const std::string & | entryPath | ) | [static, inherited] |
Returns the change time time of the entry entryPath, be it a file, a directory, etc.
entryPath | the path of the entry. |
FileSystemManagerException,which | includes GetChangeTimeFailed if the operation failed or is not supported, and FileSystemManagerDelegatingException if the underlying specialized FileSystemManager instance could not be retrieved. |
Definition at line 123 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::GetAnyDefaultFileSystemManager(), and Ceylan::System::FileSystemManager::getEntryChangeTime().
time_t StandardFileSystemManager::getEntryChangeTime | ( | const std::string & | entryPath | ) | [virtual] |
Returns the change time time of the entry entryPath, be it a file, a directory, etc.
entryPath | the path of the entry. |
GetChangeTimeFailed | if the operation failed or is not supported. |
Implements Ceylan::System::FileSystemManager.
Definition at line 166 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::explainError().
FileSystemManager & FileSystemManager::GetExistingDefaultFileSystemManager | ( | ) | [static, inherited] |
Returns a reference to the unique default filesystem manager, that is expected to exist already.
FileSystemManagerException | if the operation failed, including if there is no manager available. |
Definition at line 606 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::_CurrentDefaultFileSystemManager.
time_t StandardFileSystemManager::getLastChangeTimeDirectory | ( | const std::string & | directoryPath | ) | [virtual] |
Returns the last change time of the specified directory.
directoryPath | the path of the directory whose last change time is searched. |
DirectoryLastChangeTimeRequestFailed | if the operation failed or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 942 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::explainError().
time_t StandardFileSystemManager::getLastChangeTimeFile | ( | const std::string & | filename | ) | [virtual] |
Returns the last change time of the specified file.
filename | the filename whose last change time is searched. |
FileLastChangeTimeRequestFailed | if the operation failed or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 571 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::explainError().
TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat | ( | ) | [static, inherited] |
Returns the current overall text format to be used by TextDisplayable instances.
Definition at line 63 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::formatStringList(), Ceylan::formatStringMap(), Ceylan::XML::XMLMarkup::toString(), Ceylan::Maths::Linear::Vector3::toString(), Ceylan::Maths::Linear::Vector2::toString(), Ceylan::Maths::Linear::Tripoint::toString(), Ceylan::Module::toString(), Ceylan::Maths::Linear::Matrix3::toString(), Ceylan::Maths::Linear::Matrix2::toString(), Ceylan::Maths::Linear::HomogeneousMatrix3::toString(), and Ceylan::Maths::Linear::Bipoint::toString().
const string & FileSystemManager::GetRootDirectoryPrefix | ( | ) | [static, inherited] |
Definition at line 137 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::GetAnyDefaultFileSystemManager(), and Ceylan::System::FileSystemManager::getRootDirectoryPrefix().
const string & StandardFileSystemManager::getRootDirectoryPrefix | ( | ) | const [virtual] |
Implements Ceylan::System::FileSystemManager.
Definition at line 215 of file CeylanStandardFileSystemManager.cc.
References RootDirectoryPrefix.
Ceylan::Latin1Char FileSystemManager::GetSeparator | ( | ) | [static, inherited] |
Definition at line 147 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::GetAnyDefaultFileSystemManager(), and Ceylan::System::FileSystemManager::getSeparator().
Ceylan::Latin1Char StandardFileSystemManager::getSeparator | ( | ) | const [virtual] |
Implements Ceylan::System::FileSystemManager.
Definition at line 224 of file CeylanStandardFileSystemManager.cc.
References Separator.
std::string FileSystemManager::getSeparatorAsString | ( | ) | const [virtual, inherited] |
Definition at line 217 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::getSeparator(), and Ceylan::System::FileSystemManager::toString().
Referenced by Ceylan::System::FileSystemManager::GetSeparatorAsString(), Ceylan::System::FileSystemManager::joinPath(), Ceylan::System::LibfatDirectory::LibfatDirectory(), and Ceylan::System::StandardDirectory::StandardDirectory().
string FileSystemManager::GetSeparatorAsString | ( | ) | [static, inherited] |
Definition at line 157 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::GetAnyDefaultFileSystemManager(), and Ceylan::System::FileSystemManager::getSeparatorAsString().
Size StandardFileSystemManager::getSize | ( | const std::string & | filename | ) | [virtual] |
Returns the size, in bytes, of the specified file.
filename | the filename whose size is searched. |
FileSizeRequestFailed | if the operation failed (ex: file not found) or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 520 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::explainError(), and Ceylan::System::StandardFile::InterpretState().
Referenced by copyFile().
StandardFileSystemManager & StandardFileSystemManager::GetStandardFileSystemManager | ( | ) | [static] |
Returns a reference to the unique standard filesystem manager.
Does not set this filesystem manager as the default one.
Creates it if needed: this method ensures it remains a singleton.
Must be public, as ancestor has to be able to call it.
StandardFileSystemManagerException | if the operation failed. |
Definition at line 1192 of file CeylanStandardFileSystemManager.cc.
References _StandardFileSystemManager, and StandardFileSystemManager().
Referenced by Ceylan::System::StandardFile::ConvertToStreamOpenFlag(), Ceylan::System::StandardFile::getCorrespondingFileSystemManager(), Ceylan::System::StandardDirectory::getCorrespondingFileSystemManager(), and Ceylan::System::FileSystemManager::SetDefaultFileSystemManagerToPlatformDefault().
bool StandardFileSystemManager::isAbsolutePath | ( | const std::string & | path | ) | [virtual] |
Tells whether specified path is an absolute path.
path | the path that may be absolute. |
Implements Ceylan::System::FileSystemManager.
Definition at line 1007 of file CeylanStandardFileSystemManager.cc.
References generalUtils::false, Ceylan::isLetter(), Separator, and generalUtils::true.
bool StandardFileSystemManager::isAValidDirectoryPath | ( | const std::string & | directoryString | ) | [virtual] |
Returns whether specified string is a valid directory path.
(i.e. checks the name can be used, does not look-up any real filesystem entry).
directoryString | the directory string to examine. |
Implements Ceylan::System::FileSystemManager.
Definition at line 983 of file CeylanStandardFileSystemManager.cc.
References Ceylan::RegExp::matches(), RootDirectoryPrefix, Separator, and generalUtils::true.
bool FileSystemManager::IsDefaultFileSystemManagerSet | ( | ) | [static, inherited] |
Returns whether the default filesystem manager is set.
Definition at line 527 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::_CurrentDefaultFileSystemManager.
string FileSystemManager::joinPath | ( | const std::string & | firstPath, | |
const std::string & | secondPath | |||
) | [virtual, inherited] |
Definition at line 461 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::getSeparatorAsString().
string FileSystemManager::joinPath | ( | const std::list< std::string > & | pathElements | ) | [virtual, inherited] |
Definition at line 442 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::getSeparatorAsString().
Referenced by Ceylan::System::StandardDirectory::getSortedEntries(), Ceylan::System::Directory::goDown(), Ceylan::System::StandardDirectory::hasDirectory(), Ceylan::System::LibfatDirectory::hasDirectory(), Ceylan::System::StandardDirectory::hasEntry(), Ceylan::System::LibfatDirectory::hasEntry(), Ceylan::System::StandardDirectory::hasFile(), Ceylan::System::LibfatDirectory::hasFile(), Ceylan::System::Directory::JoinPath(), Ceylan::System::LibfatDirectory::LibfatDirectory(), removeDirectory(), Ceylan::System::LibfatFileSystemManager::removeDirectory(), and Ceylan::System::StandardDirectory::StandardDirectory().
void StandardFileSystemManager::moveDirectory | ( | const std::string & | sourceDirectoryPath, | |
const std::string & | targetDirectoryPath | |||
) | [virtual] |
Moves the directory on filesystem.
A special case of directory moving is directory renaming.
sourceDirectoryPath | the path of the directory to be moved. | |
targetDirectoryPath | the path of the target directory. |
DirectoryMoveFailed | if the operation failed or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 888 of file CeylanStandardFileSystemManager.cc.
References copyDirectory(), dataUtils::e, Ceylan::System::explainError(), removeDirectory(), and Ceylan::Exception::toString().
void StandardFileSystemManager::moveFile | ( | const std::string & | sourceFilename, | |
const std::string & | targetFilename | |||
) | [virtual] |
Moves the file on filesystem.
A special case of file moving is file renaming.
sourceFilename | the filename of the file to be moved. | |
targetFilename | the target filename of the moved file. |
FileMoveFailed | if the operation failed or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 337 of file CeylanStandardFileSystemManager.cc.
References copyFile(), dataUtils::e, Ceylan::System::explainError(), removeFile(), and Ceylan::Exception::toString().
Directory & StandardFileSystemManager::openDirectory | ( | const std::string & | directoryName = "" |
) | [virtual] |
Returns a Directory reference on specified already-existing directory, which will be "opened" (i.e.
referred to).
directoryName | the name of the directory. If not specified (the string is empty), returns a reference to the current working directory. |
DirectoryException,including | DirectoryOpeningFailed if the directory opening failed. |
Implements Ceylan::System::FileSystemManager.
Definition at line 660 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::StandardDirectory::Open().
File & StandardFileSystemManager::openFile | ( | const std::string & | filename, | |
OpeningFlag | openFlag = File::OpenToReadBinary | |||
) | [virtual] |
Returns a File reference on specified already-existing file, which will be opened with specified settings.
filename | the name of the file. | |
openFlag | the flag describing the opening mode. |
FileException,including | FileOpeningFailed if the operation failed or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 249 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::StandardFile::Open().
StandardFileSystemManager& Ceylan::System::StandardFileSystemManager::operator= | ( | const StandardFileSystemManager & | 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 FileSystemManager::RemoveDefaultFileSystemManager | ( | ) | [static, inherited] |
Removes the current default filesystem manager, if any.
Definition at line 632 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::_CurrentDefaultFileSystemManager.
void StandardFileSystemManager::removeDirectory | ( | const std::string & | directoryPath, | |
bool | recursive = false | |||
) | [virtual] |
Removes the directory from filesystem.
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. |
DirectoryRemoveFailed | if the operation failed or is not supported. |
Implements Ceylan::System::FileSystemManager.
Definition at line 738 of file CeylanStandardFileSystemManager.cc.
References CEYLAN_ARCH_WINDOWS, dataUtils::d, Ceylan::System::explainError(), Ceylan::System::StandardDirectory::getEntries(), Ceylan::System::FileSystemManager::joinPath(), Ceylan::System::StandardDirectory::Open(), and Ceylan::System::FileSystemManager::removeLeadingSeparator().
Referenced by moveDirectory().
void StandardFileSystemManager::removeFile | ( | const std::string & | filename | ) | [virtual] |
Removes the file or symbolic link from the filesystem.
filename | the filename to remove. |
FileRemoveFailed | if the operation failed or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 305 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::explainError().
Referenced by moveFile().
void FileSystemManager::removeLeadingSeparator | ( | std::string & | path | ) | [virtual, inherited] |
Removes the leading separator, if any, in specified directory's path.
path | the path that will be modified. |
Definition at line 377 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::getSeparator().
Referenced by removeDirectory(), Ceylan::System::LibfatFileSystemManager::removeDirectory(), Ceylan::System::Directory::removeLeadingSeparator(), and Ceylan::System::Directory::RemoveLeadingSeparator().
void StandardFileSystemManager::RemoveStandardFileSystemManager | ( | ) | [static] |
Removes the current standard filesystem manager, if any.
Must be public, as ancestor has to be able to call it.
Definition at line 1204 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::FileSystemManager::_CurrentDefaultFileSystemManager, and _StandardFileSystemManager.
void FileSystemManager::SetDefaultFileSystemManager | ( | FileSystemManager & | newDefaultFileSystemManager, | |
bool | deallocatePreviousIfAny = true | |||
) | [static, inherited] |
Sets the default filesystem manager, the one that will be used if no filesystem manager is specified otherwise.
deallocatePreviousIfAny | if true, any previously existing manager will be deallocated. If false, it would be replaced by not deleted. |
Definition at line 536 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::_CurrentDefaultFileSystemManager.
void FileSystemManager::SetDefaultFileSystemManagerToPlatformDefault | ( | ) | [static, inherited] |
Sets the default filesystem manager to the platform default, i.e.
to the manager that is the more natural for the target platform.
On computers (be they UNIX or Windows), the default manager is by default the standard one (StandardFileSystemManager).
On the Nintendo DS, it is the libfat one (LibfatFileSystemManager).
Any previously existing manager will be deallocated first.
FileSystemManagerException | if the operation failed or is not supported. |
Definition at line 562 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::_CurrentDefaultFileSystemManager, Ceylan::System::LibfatFileSystemManager::GetLibfatFileSystemManager(), and GetStandardFileSystemManager().
Referenced by Ceylan::System::FileSystemManager::GetAnyDefaultFileSystemManager().
void TextDisplayable::SetOutputFormat | ( | TextOutputFormat | newOutputFormat | ) | [static, inherited] |
Sets the current overall text format to be used by TextDisplayable instances.
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 > FileSystemManager::splitPath | ( | const std::string & | path | ) | [virtual, inherited] |
Definition at line 387 of file CeylanFileSystemManager.cc.
References generalUtils::false, Ceylan::System::FileSystemManager::getSeparator(), and generalUtils::true.
Referenced by Ceylan::System::LibfatDirectory::LibfatDirectory(), Ceylan::System::Directory::SplitPath(), and Ceylan::System::StandardDirectory::StandardDirectory().
void FileSystemManager::stripFilename | ( | const std::string & | path, | |
std::string * | base, | |||
std::string * | file = 0 | |||
) | [virtual, 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 '/'.
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". |
Definition at line 471 of file CeylanFileSystemManager.cc.
References Ceylan::System::FileSystemManager::getSeparator().
Referenced by Ceylan::System::Directory::StripFilename().
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.
displayables | a list of pointers to TextDisplayable instances/ | |
level | the requested verbosity level. |
Definition at line 45 of file CeylanTextDisplayable.cc.
References Ceylan::formatStringList().
const string StandardFileSystemManager::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns a user-friendly description of the state of this object.
level | the requested verbosity level. |
Reimplemented from Ceylan::System::FileSystemManager.
Definition at line 1177 of file CeylanStandardFileSystemManager.cc.
void StandardFileSystemManager::touch | ( | const std::string & | filename | ) | [virtual] |
Updates the last access and modification times of specified file.
This is not expected to work for directories.
filename | the filename of the file whose times must be updated. |
FileTouchFailed | if the operation failed or is not supported on this platform. |
Implements Ceylan::System::FileSystemManager.
Definition at line 612 of file CeylanStandardFileSystemManager.cc.
References Ceylan::System::explainError().
std::string FileSystemManager::transformIntoValidFilename | ( | const std::string & | rawFilename | ) | [virtual, inherited] |
Takes specified rawFilename and tries to transform it so that the result should be a valid name, from the filesystem's point of view.
rawFilename | the filename to convert |
Definition at line 233 of file CeylanFileSystemManager.cc.
Referenced by Ceylan::System::File::TransformIntoValidFilename().
FileSystemManager * FileSystemManager::_CurrentDefaultFileSystemManager = 0 [static, protected, inherited] |
Pointer to the default filesystem manager (if any).
This default manager is, unless specified otherwise, the one that is deemed the most natural for the target running platform: standard one for computers (either UNIX or Windows), libfat-based one for the Nintendo DS.
Definition at line 1146 of file CeylanFileSystemManager.h.
Referenced by Ceylan::System::FileSystemManager::GetAnyDefaultFileSystemManager(), Ceylan::System::FileSystemManager::GetExistingDefaultFileSystemManager(), Ceylan::System::FileSystemManager::IsDefaultFileSystemManagerSet(), Ceylan::System::FileSystemManager::RemoveDefaultFileSystemManager(), Ceylan::System::LibfatFileSystemManager::RemoveLibfatFileSystemManager(), RemoveStandardFileSystemManager(), Ceylan::System::FileSystemManager::SetDefaultFileSystemManager(), and Ceylan::System::FileSystemManager::SetDefaultFileSystemManagerToPlatformDefault().
TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited] |
The text format to be used currently by TextDisplayable instances.
Definition at line 158 of file CeylanTextDisplayable.h.
Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().
StandardFileSystemManager * StandardFileSystemManager::_StandardFileSystemManager = 0 [static, private] |
Pointer to the current standard filesystem manager (if any).
Definition at line 742 of file CeylanStandardFileSystemManager.h.
Referenced by GetStandardFileSystemManager(), RemoveStandardFileSystemManager(), and ~StandardFileSystemManager().
const string StandardFileSystemManager::RootDirectoryPrefix = "" [static, private] |
Definition at line 700 of file CeylanStandardFileSystemManager.h.
Referenced by getRootDirectoryPrefix(), and isAValidDirectoryPath().
const Ceylan::Latin1Char StandardFileSystemManager::Separator = '/' [static, private] |
Definition at line 710 of file CeylanStandardFileSystemManager.h.
Referenced by getSeparator(), isAbsolutePath(), and isAValidDirectoryPath().