Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

GAUGE3D::GConfigFile Class Reference

Access to a section-key-data config file. More...

#include <gauge3d/files/configfile.h>

List of all members.

Static Public Methods

pGVirtualDirectory Load (pGFile file)
 Loads the file into a new virtual directory and returns it. More...

bool Save (pGFile file,pGVirtualDirectory config)
 Saves the configuration to the given file. More...


Detailed Description

Access to a section-key-data config file.

GConfigFile is not derived from GFile. Heck, GConfigFile is not even an instantiable class (it is fully static). You give it a GFile to use. It treats that file as a config file in a similar format to that of win.ini on Windows systems, but with some enhancements. Each sections starts with a section title in square brackets, and ends with the same section title with a '/' infront of it, again in square brackets. Each line in the section has the format key=data. You look up settings by the key. Also note that sections can be embedded within other sections, and also that the file itself is a section, so if you don't need separate sections, you don't have to use them.

GConfigFile is actually a static class. You should not create an instance of it. Instead, use the functions within GConfigFile to load the configuration into a virtual directory. Then, you can navigate sections of the config file just as you would directories in a filesystem. Each key is a file, and the corresponding data can be retrieved from that file by casting the file to a string. (You can use normal file i/o methods to edit the configuration as well, but casting to a string will be much faster.)


Member Function Documentation

pGVirtualDirectory GAUGE3D::GConfigFile::Load ( pGFile file ) [static]
 

Loads the file into a new virtual directory and returns it.

Returns:
A pointer to the new virtual directory, or NULL if the file could not be read.

bool GAUGE3D::GConfigFile::Save ( pGFile file,
pGVirtualDirectory config ) [static]
 

Saves the configuration to the given file.

Returns:
True if successful, or false if the file was not writable.


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