Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

GAUGE3D::GVirtualDirectory Class Reference

Allows you to construct a virtual filesystem in RAM. More...

#include <gauge3d/files/virtualdirectory.h>

Inherits GAUGE3D::GDirectory.

List of all members.

Public Methods

 GVirtualDirectory ()
virtual ~GVirtualDirectory ()
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).

void AddFile (GString name,pGFile file)
 Link a file into the virtual directory. More...

void AddSubdir (GString name,pGVirtualDirectory subdir)
 Link a sub directory into the virtual directory. More...


Detailed Description

Allows you to construct a virtual filesystem in RAM.

A virtual directory exists only in RAM, and files within the directory are simply pointers to any sort of object derived from GFile. These may be disk files, temporary files, files in archives, etc.


Member Function Documentation

virtual pGFile GAUGE3D::GVirtualDirectory::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::GVirtualDirectory::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::GVirtualDirectory::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::GVirtualDirectory::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.

void GAUGE3D::GVirtualDirectory::AddFile ( GString name,
pGFile file )
 

Link a file into the virtual directory.

Parameters:
name   The name to give the file entry in the virtual directory.
file   The file that the new entry should refer to. When the entry is requested, this same pointer will be returned.

void GAUGE3D::GVirtualDirectory::AddSubdir ( GString name,
pGVirtualDirectory subdir )
 

Link a sub directory into the virtual directory.

Parameters:
name   The name to give the directory entry in the virtual directory.
subdir   The directory that the new entry should refer to. When the entry is requested, this same pointer will be returned. Must be a virtual directory, to avoid confusion.


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