FilePath represents a path to a file or directory name. More...
#include <filepath.h>
Public Member Functions | |
bool | exists () const |
FilePath | filename () const |
Returns filename of the FilePath object by pruning the path off. More... | |
FilePath (const string &path="", bool check_exists=false) | |
Constructor. More... | |
bool | isBlockSpecial () const |
bool | isCharSpecial () const |
bool | isDirectory () const |
bool | isFifo () const |
bool | isRegular () const |
bool | isSocket () const |
operator string () const | |
FilePath | operator+ (const FilePath &name) const |
Concatenates FilePath objects. More... | |
FilePath & | operator= (const string &rhs) |
Protected Member Functions | |
void | check () const |
This function sets _checked to true, stats the path, to see if it exists and to determine what type of file it is. More... | |
void | pruneTrailingSeparator () |
Prunes the trailing separator of a specified path. More... | |
FilePath represents a path to a file or directory name.
FilePath has member functions to check if the file path is a valid file system entity, and to check what kind of file system entity it is, e.g. is it a file, a directory, a pipe etc.
zipios::FilePath::FilePath | ( | const string & | path = "" , |
bool | check_exists = false |
||
) |
Constructor.
path | A string representation of the path. |
check_exists | If true is specified the constructor will check the existence and type of the path immediately, instead of deferring that task until it is needed. |
References exists(), and pruneTrailingSeparator().
Referenced by importIFClegacy.IfcWriter::write().
|
protected |
This function sets _checked to true, stats the path, to see if it exists and to determine what type of file it is.
All the query functions check if _checked is true, and if it isn't they call check(). This means stat'ing is deferred until it becomes necessary.
Referenced by exists(), isBlockSpecial(), isCharSpecial(), isDirectory(), isFifo(), isRegular(), isSocket(), and femsolver.run.Machine::reset().
bool zipios::FilePath::exists | ( | ) | const |
References check().
Referenced by FilePath().
FilePath zipios::FilePath::filename | ( | ) | const |
Returns filename of the FilePath object by pruning the path off.
Referenced by ArchReference.ArchReferenceTaskPanel::accept(), ArchReference.ArchReferenceTaskPanel::chooseFile(), addonmanager_macro.Macro::install(), addonmanager_macro.Macro::is_installed(), exportDRAWEXE.Drawexporter::process_object(), addonmanager_macro.Macro::remove(), and exportDRAWEXE.Drawexporter::saveSweep().
bool zipios::FilePath::isBlockSpecial | ( | ) | const |
References check().
bool zipios::FilePath::isCharSpecial | ( | ) | const |
References check().
bool zipios::FilePath::isDirectory | ( | ) | const |
References check().
bool zipios::FilePath::isFifo | ( | ) | const |
References check().
bool zipios::FilePath::isRegular | ( | ) | const |
References check().
zipios::FilePath::operator string | ( | ) | const |
Concatenates FilePath objects.
A file separator is inserted if appropriate.
FilePath & zipios::FilePath::operator= | ( | const string & | rhs | ) |
References pruneTrailingSeparator().
|
protected |
Prunes the trailing separator of a specified path.
Referenced by FilePath(), and operator=().