Pixel Dust Game Engine  v0.9.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | Static Protected Member Functions | Friends | List of all members
ConfigManager Class Referenceabstract
Inheritance diagram for ConfigManager:
Inheritance graph
[legend]
Collaboration diagram for ConfigManager:
Collaboration graph
[legend]

Public Member Functions

virtual bool useConfig (const char *inConfigName)=0
 
virtual bool getConfigString (const char *configItemName, std::string &outString)=0
 
virtual bool getConfigLong (const char *configItemName, long &outLongValue)=0
 
virtual bool getConfigFloat (const char *configItemName, float &outFloatValue)=0
 
virtual bool getConfigBool (const char *configItemName, bool &outBooleanValue)=0
 
virtual void setConfigString (const char *configItemName, std::string inString)=0
 
virtual void setConfigLong (const char *configItemName, long inLongValue)=0
 
virtual void setConfigFloat (const char *configItemName, float inFloatValue)=0
 
virtual void setConfigBool (const char *configItemName, bool inBooleanValue)=0
 
- Public Member Functions inherited from Singleton< ConfigManager >
 Singleton ()
 
virtual ~Singleton ()
 

Static Protected Member Functions

static ConfigManagercreateSingletonInstance ()
 create the one and only singleton instance of the ConfigManager used by the pdg engine
 

Friends

class Singleton< ConfigManager >
 

Additional Inherited Members

- Static Public Member Functions inherited from Singleton< ConfigManager >
static ConfigManagergetSingletonInstance ()
 
static bool hasInstance ()
 
static ConfigManagerinstance ()
 
static void setInstance (ConfigManager *i)
 
static ConfigManagercreateSingletonInstance ()
 

Detailed Description

Interface to Save and Load game config values. This class is a pure virtual (interface) class that provides simple configuration management. It does the right thing on each platform to save and load values that need to persist between game sessions. It is not intended to be used to hold saved games. It is not dependent on any other parts of the Pixel Dust Game Framework.

Member Function Documentation

createSingletonInstance ( )
staticprotected

create the one and only singleton instance of the ConfigManager used by the pdg engine

Returns
the ConfigManager singleton instance
virtual bool getConfigBool ( const char *  configItemName,
bool &  outBooleanValue 
)
pure virtual

Get a config value as a boolean. Search the current configuration for a config entry with the same name and return the value associated with it as a boolean value

Parameters
configItemNamename of item to search for in config, case insensitive
outBooleanValueholds config boolean value if found
Returns
false if not found, true if found and value returned via outBooleanValue
virtual bool getConfigFloat ( const char *  configItemName,
float &  outFloatValue 
)
pure virtual

Get a config value as a floating point number. Search the current configuration for a config entry with the same name and return the value associated with it as a floating point value

Parameters
configItemNamename of item to search for in config, case insensitive
outFloatValueholds config float value if found
Returns
false if not found, true if found and value returned via outFloatValue
virtual bool getConfigLong ( const char *  configItemName,
long &  outLongValue 
)
pure virtual

Get a config value as a long integer. Search the current configuration for a config entry with the same name and return the value associated with it as a long integer value

Parameters
configItemNamename of item to search for in config, case insensitive
outLongValueholds config long integer value if found
Returns
false if not found, true if found and value returned via outLongValue
virtual bool getConfigString ( const char *  configItemName,
std::string &  outString 
)
pure virtual

Get a config value as a string. Search the current configuration for a config entry with the same name and return the value associated with it as a string returns false if not found, true if found and value returned via outString

Parameters
configItemNamename of item to search for in config, case insensitive
outStringholds config string value if found
virtual void setConfigBool ( const char *  configItemName,
bool  inBooleanValue 
)
pure virtual

Add or change a config boolean value. If no config item with that name exists, one is added. Changes to the config are saved immediately. You should always use the corresponding getConfigBool call to retrieve any value stored with setConfigBool.

Parameters
configItemNamename of item in config to change or add, case not preserved
inBooleanValuethe new boolean value for the config item
virtual void setConfigFloat ( const char *  configItemName,
float  inFloatValue 
)
pure virtual

Add or change a config floating point value. If no config item with that name exists, one is added. Changes to the config are saved immediately. You should always use the corresponding getConfigFloat call to retrieve any value stored with setConfigFloat.

Parameters
configItemNamename of item in config to change or add, case not preserved
inFloatValuethe new floating point value for the config item
virtual void setConfigLong ( const char *  configItemName,
long  inLongValue 
)
pure virtual

Add or change a config long integer value. If no config item with that name exists, one is added. Changes to the config are saved immediately. You should always use the corresponding getConfigLong call to retrieve any value stored with setConfigLong.

Parameters
configItemNamename of item in config to change or add, case not preserved
inLongValuethe new long integer value for the config item
virtual void setConfigString ( const char *  configItemName,
std::string  inString 
)
pure virtual

Add or change a config value string. If no config item with that name exists, one is added. Changes to the config are saved immediately. You should always use the corresponding getConfigString call to retrieve any value stored with setConfigString.

Parameters
configItemNamename of item in config to change or add, case not preserved
inStringthe new string value for the config item
virtual bool useConfig ( const char *  inConfigName)
pure virtual

Specify the name of the configuration to use. Specify an abstract name for the config to be used. Implementations will use this to build the name of a file on disk, a registry entry, or something else that's appropriate for the platform you are running on.

Parameters
inConfigNameOnly alpha characters (uppercase and lowercase) are allowed, name is case insensitive
Returns
false if config not found, unusable or empty

Friends And Related Function Documentation

friend class Singleton< ConfigManager >
friend