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

FileConfig Class Reference

#include <file.h>

Collaboration diagram for FileConfig:

Collaboration graph
[legend]
List of all members.

Detailed Description

Contains the configuration of the game.

This class will take an file as an argument to its constructor, and parse that file and have members that will contain the contents of the file.

Author:
Stephen Bridges


Public Member Functions

 FileConfig ()
 Default constructor, with what probably aren't sensible values.
int loadConfig (const char *filename=NULL)
 Load details from file.
int saveConfig (void)
 Save the configuration to whatever file we can.
const scrnsize getScreenSize (void)
 Return the requested screen characteristics (size, depth).
const int getScreenSizeX (void)
 Return screen width.
const int getScreenSizeY (void)
 Return screen height.
const bool getFS (void)
 Whether to start in fullscreen or not.


Constructor & Destructor Documentation

FileConfig::FileConfig  ) 
 

Default constructor, with what probably aren't sensible values.

Todo:
Set more boring values.


Member Function Documentation

int FileConfig::loadConfig const char *  filename = NULL  ) 
 

Load details from file.

The interesting part. Load configuration data from a file. If a string is passed to the function then try to open that first. Otherwise $HOME/.graviton is used.

Parameters:
filename An optional file to try opening first.
Todo:
Alternate places for configuration data?

Todo:
Do something about defaults so they can be set in one place.

int FileConfig::saveConfig void   ) 
 

Save the configuration to whatever file we can.

First try a user-specified one, then $HOME/.graviton.


The documentation for this class was generated from the following files:
Generated on Mon Jan 3 15:14:19 2005 for Graviton by  doxygen 1.3.9.1