#include <mcllib/MCDirEntry.h>
Inheritance diagram for MCDirEntry:
Public Types | |
enum | EType { ENTRYTYPE_FILE = 1, ENTRYTYPE_DIR = 2, ENTRYTYPE_OTHER = 3 } |
The type of directory entry. More... | |
Public Member Functions | |
bool | exists () |
Check to see if the entry exists in the filesystem. | |
mctime_t | getCreateTime () |
Get the create time of the filesystem entry. | |
mctime_t | getModifyTime () |
Get the modification time of the filesystem entry. | |
const MCString & | getName () const |
Get the name of the directory entry. | |
MCString | getNormalizedName () const |
Get the name of the directory entry in a platform independent string. | |
EType | getType () const |
Get the type of the entry. | |
MCString | head () const |
Get the head of the directory entry (directory part). | |
bool | isDir () const |
Test if the item is a directory. | |
bool | isFile () const |
Test if the item is a file. | |
bool | isReadable () |
Check to see if the entry is readable in the filesystem. | |
bool | isWriteable () |
Check to see if the entry is writeable in the filesystem. | |
MCDirEntry (const MCString &name, EType type) | |
Construct a directory entry from a name and type. | |
MCDirEntry (const MCString &name) | |
Construct a directory entry from an item in the filesystem. | |
MCDirEntry (EType type) | |
Construct a directory entry of a particular type. | |
MCDirEntry () | |
Default constructor. | |
void | remove () |
Remove the filesystem entry. | |
void | rename (const MCString &to) |
Rename the filesystem entry. | |
mcint64 | size () |
Get the size of the filesystem entry. | |
MCString | tail () const |
Get the tail of the directory entry (file part). | |
~MCDirEntry () | |
Destructor. |
Directory entries do not need to exist in a filesystem. However some of the member functions obtain information from the filesystem. In this description, filesystem entry is used to refer to the physical object, whereas directory entry is used to refer to the logical object (whether it exists or not). Entry is used to refer to the object when it could be used in either context. When a directory entry is constructed, the name provided can be either a path using the operating system file separator or the normalized separator (/). If the path uses the normalized separator it is automatically converted to a path using the operating system file separator. The path also has adjacent seperators, . and .. eliminated (whether or not the path exists in the file system). Elimination of parent directory (..) relies on the path being an absolute path (starting with a leading path separator character).
|
The type of directory entry.
|
|
Construct a directory entry of a particular type.
|
|
Construct a directory entry from an item in the filesystem.
|
|
Construct a directory entry from a name and type. The filesystem is not accessed, so name need not exist.
|
|
Check to see if the entry exists in the filesystem.
|
|
Get the create time of the filesystem entry. This call will access the filesystem and throw on error
|
|
Get the modification time of the filesystem entry. This call will access the filesystem and throw on error
|
|
Get the name of the directory entry.
|
|
Get the name of the directory entry in a platform independent string.
|
|
Get the type of the entry. This will be the real type if the entry was constructed without a type, since the file system will have been checked and the real type obtained through the check. Otherwise it will simply be the type provided at construction.
|
|
Get the head of the directory entry (directory part).
|
|
Test if the item is a directory.
|
|
Test if the item is a file.
|
|
Check to see if the entry is readable in the filesystem.
|
|
Check to see if the entry is writeable in the filesystem.
|
|
Remove the filesystem entry. This call will access the filesystem and throw on error. For directories, the directory will be removed (if empty). |
|
Rename the filesystem entry. This call will access the filesystem and throw on error.
|
|
Get the size of the filesystem entry. This call will access the filesystem and throw on error
|
|
Get the tail of the directory entry (file part).
|