PDG engine v0.9.5
 All Classes Namespaces Functions Variables Groups Pages
Public Member Functions | Related Functions | List of all members
ConfigManager Class Reference

used for loading and saving application configuration info More...

Public Member Functions

boolean getConfigBool (string inConfigItemName)
 get boolean configuration value
 
number getConfigFloat (string inConfigItemName)
 get floating point numerical configuration value
 
number getConfigLong (string inConfigItemName)
 get integer numerical configuration value
 
string getConfigString (string inConfigItemName)
 get string configuration value
 
 setConfigBool (string inConfigItemName, boolean inValue)
 set boolean configuration value
 
 setConfigFloat (string inConfigItemName, number inValue)
 set floating point numerical configuration value
 
 setConfigLong (string inConfigItemName, int inValue)
 set integer numerical configuration value
 
 setConfigString (string inConfigItemName, string inValue)
 set string configuration value
 
boolean useConfig (string inConfigName)
 specify the abstract configuration
 

Related Functions

(Note that these are not member functions.)

 cfg
 the singleton instance of the ConfigManager
 
 getConfigManager
 get the singleton instance of the ConfigManager used by the pdg framework
 

Detailed Description

used for loading and saving application configuration info

Precondition
API Stability: 3 - Stable. The API has proven satisfactory, but cleanup in the underlying code may cause minor changes. Backwards-compatibility is guaranteed.

Interface to Save and Load game config values. This class provides simple platform neutral 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.

Note
config item names are not case-sensitive, and case is not preserved in the internal implementation

Member Function Documentation

getConfigBool ( string  inConfigItemName)

get boolean configuration value

Get the boolean value for a named configuration item. If the item does not exist, undefined will be returned rather than a boolean.

Parameters
inConfigItemNamethe name of the configuration item
Returns
a boolean value, or undefined if that config item was not set
getConfigFloat ( string  inConfigItemName)

get floating point numerical configuration value

Get the numerical value for a named configuration item. If the item does not exist, undefined will be returned rather than a number.

Parameters
inConfigItemNamethe name of the configuration item
Returns
a numerical value, or undefined if that config item was not set
getConfigLong ( string  inConfigItemName)

get integer numerical configuration value

Get the numerical value for a named configuration item. If the item does not exist, undefined will be returned rather than a number.

Parameters
inConfigItemNamethe name of the configuration item
Returns
a numerical value, or undefined if that config item was not set
getConfigString ( string  inConfigItemName)

get string configuration value

Get the string value for a named configuration item. If the item does not exist, undefined will be returned rather than a string.

Parameters
inConfigItemNamethe name of the configuration item
Returns
a string value, or undefined if that config item was not set
setConfigBool ( string  inConfigItemName,
boolean  inValue 
)

set boolean configuration value

Set the boolean value for the named configuration item

Parameters
inConfigItemNamethe name of the configuration item
inValuethe value for the config item
setConfigFloat ( string  inConfigItemName,
number  inValue 
)

set floating point numerical configuration value

Set the numeric value for the named configuration item

Parameters
inConfigItemNamethe name of the configuration item
inValuethe value for the config item
setConfigLong ( string  inConfigItemName,
int  inValue 
)

set integer numerical configuration value

Set the integer value for the named configuration item

Parameters
inConfigItemNamethe name of the configuration item
inValuethe value for the config item
setConfigString ( string  inConfigItemName,
string  inValue 
)

set string configuration value

Set the string value for the named configuration item

Parameters
inConfigItemNamethe name of the configuration item
inValuethe value for the config item
useConfig ( string  inConfigName)

specify the abstract configuration

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 not case sensitive
Returns
false if config not found, unusable or empty

Friends And Related Function Documentation

getConfigManager
related

get the singleton instance of the ConfigManager used by the pdg framework

Returns
ConfigManager singleton object

User Comments