Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

GAUGE3D::GDiskDirectory Class Reference

A directory on a disk. More...

#include <gauge3d/files/diskdirectory.h>

Inherits GAUGE3D::GDirectory.

List of all members.

Public Methods

 GDiskDirectory ()
 Create without opening a directory.

 GDiskDirectory (GString dirname)
 Create and open the given directory.

virtual ~GDiskDirectory ()
 Close the directory.

bool Open (GString dirname)
 Opens a particular directory. More...

void Close ()
 Closes the directory.

bool IsOpen ()
 Returns true if the directory is open.

virtual GArray<GStringListFiles ()
 Get a list of all the files in the directory.

virtual GArray<GStringListSubdirs ()
 Get a list of all the subdirectories of the directory.

virtual pGFile OpenFile (GString name)
 Get a pointer to a file in the directory. More...

virtual pGDirectory OpenSubdir (GString name)
 Get a pointer to a sub directory in the directory. More...

virtual pGFile AddFile (GString name)
 Create a new file in the directory. More...

virtual pGDirectory AddSubdir (GString name)
 Create a new sub directory to the directory. More...

virtual void RemoveFile (GString name)
 Remove a file from the dircetory.

virtual void RemoveDirectory (GString name)
 Remove a sub directory from the directory (recursively if necessary).


Detailed Description

A directory on a disk.

GDiskDirectory is an actual file on the hard drive or other disk.


Member Function Documentation

bool GAUGE3D::GDiskDirectory::Open ( GString dirname )
 

Opens a particular directory.

Parameters:
dirname   The path and name of the directory on disk.
Returns:
True on success, false on error.

virtual pGFile GAUGE3D::GDiskDirectory::OpenFile ( GString name ) [virtual]
 

Get a pointer to a file in the directory.

Parameters:
name   The name of the file to open.
Remarks:
Use this to open the contents of a directory. This way, if you have a pointer to the root directory of any filesystem, you can access everything in the system.
Note:
It is perfectly legal to say:
  • myDirectory.OpenFile("this/is/a/deeply/nested/file");
Likewise with OpenSubdir(). You need not manually traverse the directory tree.
Always use forward slashes ('/') to separate directories. Using back slashes ('\') will not work, even on Windows.

Reimplemented from GAUGE3D::GDirectory.

virtual pGDirectory GAUGE3D::GDiskDirectory::OpenSubdir ( GString name ) [virtual]
 

Get a pointer to a sub directory in the directory.

Parameters:
name   The name of the sub directory to open.
Remarks:
Use this to open the contents of a directory. This way, if you have a pointer to the root directory of any filesystem, you can access everything in the system.
Note:
It is perfectly legal to say:
  • myDirectory.OpenFile("this/is/a/deeply/nested/subdir");
Likewise with OpenSubdir(). You need not manually traverse the directory tree.
Always use forward slashes ('/') to separate directories. Using back slashes ('\') will not work, even on Windows.

Reimplemented from GAUGE3D::GDirectory.

virtual pGFile GAUGE3D::GDiskDirectory::AddFile ( GString name ) [virtual]
 

Create a new file in the directory.

Parameters:
name   The name of the file to create.
Returns:
A pointer to the new file, or NULL if the file already existed or could not be created.

Reimplemented from GAUGE3D::GDirectory.

virtual pGDirectory GAUGE3D::GDiskDirectory::AddSubdir ( GString name ) [virtual]
 

Create a new sub directory to the directory.

Parameters:
name   The name of the sub directory to create.
Returns:
A pointer to the new directory, or NULL if the directory already existed or could not be created.

Reimplemented from GAUGE3D::GDirectory.


The documentation for this class was generated from the following file:
Generated at Tue Jan 30 17:07:34 2001 for gauge3d by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000