Instances of DtLgrFilename are DtStrings which convert filenames to the native format. More...
Inheritance diagram for MAKLogger::DtLgrFilename:
Collaboration diagram for MAKLogger::DtLgrFilename:Public Member Functions | |
| DtLgrFilename () | |
| default constructor | |
| DtLgrFilename (const char *str) | |
| constructor | |
| virtual | ~DtLgrFilename () |
| destructor | |
| DtLgrFilename (const DtLgrFilename &orig) | |
| copy constructor | |
| DtLgrFilename & | operator= (const DtLgrFilename &orig) |
| assignment operator | |
| DtLgrFilename & | operator= (const DtString &orig) |
| DtLgrFilename & | operator= (const char *orig) |
| virtual bool | absolute () const |
| Returns true if the filename is an absolute filename, or a relative filename, respectively. | |
| virtual bool | relative () const |
| virtual void | append (DtLgrFilename const &filename) |
| This filename is considered a path and the supplied filename is appended. | |
| virtual void | prefix (DtLgrFilename const &pathName) |
| This filename is considered a relative path (or filename) and the supplied path is prefixed. | |
| virtual DtString | extension () const |
| Returns the file extension, which are all the characters following the last '. | |
| virtual void | setExtension (const DtString &extension) |
| Sets the extension for the filename, if the existing file has an extension it is removed, else this extension is appended. | |
| virtual void | stripFilename () |
| Strip the filename from this path. | |
| virtual void | stripPath () |
| Strip the path from this filename. | |
| virtual bool | isWritable () const |
| Returns true if the filename is writable. | |
| virtual bool | isReadable () const |
| Return true if the filename is readable. | |
| virtual unsigned long | fileLength () const |
| Returns the size of the file in bytes. | |
| virtual bool | exists () const |
| Returns true if the filename exists. | |
Static Public Member Functions | |
| static const DtLgrFilename & | nullFilename () |
| Return empty filename. | |
| static DtLgrFilename | stripFilename (const DtLgrFilename &orig) |
| Strip the filename from a path. | |
| static DtLgrFilename | stripPath (const DtLgrFilename &orig) |
| Strip the path from a filename. | |
| static DtLgrFilename | combine (const DtLgrFilename &path, const DtLgrFilename &filename) |
| Constructs a new filename by combining the path with filename, which is an absolute or relative path. | |
| static char | separator () |
| Returns the separator used in representing directories. | |
Protected Member Functions | |
| void | replaceSlashes () |
| Replaces slashes. | |
Static Protected Attributes | |
| static const char | theSeparator |
Instances of DtLgrFilename are DtStrings which convert filenames to the native format.
| virtual bool MAKLogger::DtLgrFilename::absolute | ( | ) | const [virtual] |
Returns true if the filename is an absolute filename, or a relative filename, respectively.
| virtual void MAKLogger::DtLgrFilename::append | ( | DtLgrFilename const & | filename | ) | [virtual] |
This filename is considered a path and the supplied filename is appended.
The filename may be an absolute or relative path. If the filename is absolute, then it replaces this one. A separator is inserted between this path and the filename if necessary.
| static DtLgrFilename MAKLogger::DtLgrFilename::combine | ( | const DtLgrFilename & | path, |
| const DtLgrFilename & | filename | ||
| ) | [static] |
Constructs a new filename by combining the path with filename, which is an absolute or relative path.
If the filename is an absolute filename, then filename is returned. If the filename is a relative filename, then path is prefixed to it.
| virtual DtString MAKLogger::DtLgrFilename::extension | ( | ) | const [virtual] |
Returns the file extension, which are all the characters following the last '.
' period. If there is no extension in the filename, an empty string is returned.
| virtual unsigned long MAKLogger::DtLgrFilename::fileLength | ( | ) | const [virtual] |
Returns the size of the file in bytes.
If file does not exist results are undefined.
| virtual void MAKLogger::DtLgrFilename::prefix | ( | DtLgrFilename const & | pathName | ) | [virtual] |
This filename is considered a relative path (or filename) and the supplied path is prefixed.
The path name may be an absolute or relative path. If this filename is absolute it is left unchanged. A separator is inserted between the path and this filename if necessary.
| void MAKLogger::DtLgrFilename::replaceSlashes | ( | ) | [protected] |
Replaces slashes.
On unix, this replaces backslashes with forward slashes. Vice versa on win32. Hail Mr Gates. This is not virtual, because we call this from the constructors and destructor.
| virtual void MAKLogger::DtLgrFilename::setExtension | ( | const DtString & | extension | ) | [virtual] |
Sets the extension for the filename, if the existing file has an extension it is removed, else this extension is appended.
The extension string does NOT need a leading period.