- Inherits from:
- Object
- Declared in:
- DDirectory.h
Object
|
+---DDirectory
Class Description
The DDirectory class implements a number of methods for using directory paths.
The paths are not checked by the ofc-library; this is left to the underlying os-specific
functions. This class has also a number of class methods for creating, deleting, renaming
and scanning directories.
- Last modified:
- 27-Dec-2005 (DDirectory.h)
Instance Variables
- private DText *_path
- the path (and name) of the directory
- Constructors
- - (DDirectory *) init
- Initialise an empty directory object
- Returns:
- the object
- - (DDirectory *) init :(const char *) path
- Initialise the object with a directory path
- Returns:
- the object
- Deconstructor
- - free
- Free the object
- Returns:
- the file object
- Copy related methods
- - deepen
- Deepen a copied object
- Returns:
- the object
- Class methods
- + (DList *) childs :(const char *) path :(id <DTextFilterable>) filter
- Return a list with the filenames in the directory
- Parameters:
- path - the directory path
filter - the filter for the names (or nil for no filter)
- Returns:
- a (new) list met DText objects (or nil)
- + (BOOL) create :(const char *) path
- Create a directory
- Parameters:
- path - the path
- Returns:
- success
- + (DDirectory *) current
- Return the current working directory
- Returns:
- a (new) directory object with the current directory (or nil)
- + (BOOL) current :(const char *) path
- Set the current working directory
- Parameters:
- path - the path for the current directory
- Returns:
- success
- + (int) error
- Return the last error for the class methods
- Returns:
- the last error
- + (BOOL) exist :(const char *) path
- Check if the directory exist
- Parameters:
- path - the directory path
- Returns:
- does it ?
- + (BOOL) isDriveSeparator :(char) ch
- Check if the character is a drive separator
(there is no check for misuse of ':' on WIN32)
- Parameters:
- ch - the character
- Returns:
- is it a drive separator ?
- + (BOOL) isPathSeparator :(char) ch
- Check if the character is a path separator
- Parameters:
- ch - the character
- Returns:
- is it a path separator ?
- + (BOOL) move :(const char *) path :(const char *) newPath
- Move/Rename a directory
- Parameters:
- path - the current path
newPath - the new path
- Returns:
- success
- + (BOOL) remove :(const char *) path
- Remove a directory
- Parameters:
- path - the path
- Returns:
- success
- + (DDirectory *) temp
- Return the temp directory
- Returns:
- a (new) DDirectory object with the temp directory path (or nil)
- Member methods
- - (DDirectory *) child :(const char *) name
- Add a subdirectory to the directory object
- Parameters:
- name - the name of the subdirectory
- Returns:
- the object
- - (char) drive
- Return the drive letter
- Returns:
- the drive letter (or EOS if not present)
- - (BOOL) isAbsolute
- Check if the directory has an absolute path
- Returns:
- is the path absolute ?
- - (BOOL) isEmpty
- Check if the directory path is empty
- Returns:
- is it ?
- - (const char *) name
- Return the directory name in the path
- Returns:
- (a reference to) the name (or NULL)
- - (DList *) names
- Split up the path in a list of directory names
- Returns:
- a (new) list with the the names (in DText objects)
- - (DDirectory *) names :(DList *) names
- Build the path with a list of directory names
- Parameters:
- names - a list of objects that respond to the textable protocol
- Returns:
- the object
- - (BOOL) parent
- Move the directory path to the parent directory
- Returns:
- was there a parent directory ?
- - (const char *) path
- Return the path (and name) of the directory
- Returns:
- the path
- - (DDirectory *) path :(const char *) path
- Set the path for the directory
- Parameters:
- path - the path for the directory
- Returns:
- the object
generated 08-Jan-2006 by ObjcDoc 3.0.0