Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MCDir Class Reference

Representation of a directory. More...

#include <mcllib/MCDir.h>

Inheritance diagram for MCDir:

MCDirEntry List of all members.

Public Member Functions

void create (mcintn mode=0777)
 Create the directory if it doesn't exist.
MCDirEnum getEnum ()
 Get an enumeration (list of contained objects).
 MCDir (const MCString &name)
 Construct a directory from the specified name.
 MCDir ()
 Default constructor.
void setCurrent ()
 Set the current (working) directory.

Static Public Member Functions

MCDir getCurrent ()
 Get the current directory.
void setCurrent (const MCString &dirName)
 Set the current (working) directory.

Detailed Description

Representation of a directory.


Constructor & Destructor Documentation

MCDir  ) 
 

Default constructor.

Creates an unnamed directory entry.

MCDir const MCString name  ) 
 

Construct a directory from the specified name.

Construction does not create the directory or access the filesystem.

Parameters:
name the name to use for the directory


Member Function Documentation

void create mcintn  mode = 0777  ) 
 

Create the directory if it doesn't exist.

If access modes are supported on the platform, and it doesn't already exist then the new directory is created with the specified mode. If the directory cannot be created an exception is thrown.

Parameters:
mode the access mode for the directory if it doesn't already exist.

MCDir getCurrent  )  [static]
 

Get the current directory.

This can be used (for instance) to obtain the name of the working directory (call getName() on the returned MCDir).

Returns:
an MCDir object that represents the current (or working) directory.

MCDirEnum getEnum  ) 
 

Get an enumeration (list of contained objects).

If the directory does not exist in the filesystem or an enumeration cannot be created (e.g. scan access is prohibited for the current user) an exception is thrown.

Returns:
a directory enumeration object

void setCurrent const MCString dirName  )  [static]
 

Set the current (working) directory.

Set dirName to be the current (or working) directory (i.e. change directory). The application as a whole has a single working directory. Care should be taken when calling this method from different threads. If the directory does not exist or cannot otherwise be set as the current directory an exception is thrown.

Parameters:
dirName the directory to use as the new current directory

void setCurrent  ) 
 

Set the current (working) directory.

Set this directory entry to be the current (or working) directory (i.e. change directory). The application as a whole has a single working directory. Care should be taken when calling this method from different threads. If the directory does not exist or cannot otherwise be set as the current directory an exception is thrown.


Generated on Wed Jan 12 19:05:49 2005 for MCLLIB by  doxygen 1.3.9.1