#include <gauge3d/files/configfile.h>
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... |
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.)
|
Loads the file into a new virtual directory and returns it.
|
|
Saves the configuration to the given file.
|