Open Game Engine 2D API
 All Functions Variables
Functions
Config

Functions

int OGE_OpenCustomConfig (string sConfigFile)
 Open custom configuration file (ini file)
int OGE_CloseCustomConfig (int iConfigId)
 Close the custom config file.
int OGE_GetDefaultConfig ()
 Get the default config.
int OGE_GetAppConfig ()
 Get the application config.
string OGE_ReadConfigStr (int iConfigId, string sSectionName, string sFieldName, string sDefault)
 Read a string from the config.
int OGE_ReadConfigInt (int iConfigId, string sSectionName, string sFieldName, int iDefault)
 Read an integer from the config.
double OGE_ReadConfigFloat (int iConfigId, string sSectionName, string sFieldName, double fDefault)
 Read a floating-point value from the config.
bool OGE_WriteConfigStr (int iConfigId, string sSectionName, string sFieldName, string sValue)
 Write a string into the config.
bool OGE_WriteConfigInt (int iConfigId, string sSectionName, string sFieldName, int iValue)
 Write an integer value into the config.
bool OGE_WriteConfigFloat (int iConfigId, string sSectionName, string sFieldName, double fValue)
 Write a floating-point value into the config.
bool OGE_SaveConfig (int iConfigId)
 Save the config.
int OGE_SaveDataToConfig (int iDataId, int iConfigId)
 Save the data into the config.
int OGE_LoadDataFromConfig (int iDataId, int iConfigId)
 Load the data from the config.

Function Documentation

int OGE_CloseCustomConfig ( int  iConfigId)

Close the custom config file.

Parameters:
[in]iConfigIdThe ID of the config
Returns:
Return a non-negative number if succeed

Get the application config.

Returns:
The ID of the config

Get the default config.

Returns:
The ID of the config
int OGE_LoadDataFromConfig ( int  iDataId,
int  iConfigId 
)

Load the data from the config.

Parameters:
[in]iDataIdThe ID of the data
[in]iConfigIdThe ID of the config
Returns:
Return a non-negative number if succeed
int OGE_OpenCustomConfig ( string  sConfigFile)

Open custom configuration file (ini file)

Parameters:
[in]sConfigFileThe path of the config file
Returns:
The ID of the config
double OGE_ReadConfigFloat ( int  iConfigId,
string  sSectionName,
string  sFieldName,
double  fDefault 
)

Read a floating-point value from the config.

Parameters:
[in]iConfigIdThe ID of the config
[in]sSectionNameThe section name
[in]sFieldNameThe field name
[in]fDefaultThe default value
Returns:
The floating-point value
int OGE_ReadConfigInt ( int  iConfigId,
string  sSectionName,
string  sFieldName,
int  iDefault 
)

Read an integer from the config.

Parameters:
[in]iConfigIdThe ID of the config
[in]sSectionNameThe section name
[in]sFieldNameThe field name
[in]iDefaultThe default value
Returns:
The integer value
string OGE_ReadConfigStr ( int  iConfigId,
string  sSectionName,
string  sFieldName,
string  sDefault 
)

Read a string from the config.

Parameters:
[in]iConfigIdThe ID of the config
[in]sSectionNameThe section name
[in]sFieldNameThe field name
[in]sDefaultThe default value
Returns:
The string
bool OGE_SaveConfig ( int  iConfigId)

Save the config.

Parameters:
[in]iConfigIdThe ID of the config
Returns:
Succeed or not
int OGE_SaveDataToConfig ( int  iDataId,
int  iConfigId 
)

Save the data into the config.

Parameters:
[in]iDataIdThe ID of the data
[in]iConfigIdThe ID of the config
Returns:
Return a non-negative number if succeed
bool OGE_WriteConfigFloat ( int  iConfigId,
string  sSectionName,
string  sFieldName,
double  fValue 
)

Write a floating-point value into the config.

Parameters:
[in]iConfigIdThe ID of the config
[in]sSectionNameThe section name
[in]sFieldNameThe field name
[in]fValueThe floating-point value
Returns:
Succeed or not
bool OGE_WriteConfigInt ( int  iConfigId,
string  sSectionName,
string  sFieldName,
int  iValue 
)

Write an integer value into the config.

Parameters:
[in]iConfigIdThe ID of the config
[in]sSectionNameThe section name
[in]sFieldNameThe field name
[in]iValueThe integer value
Returns:
Succeed or not
bool OGE_WriteConfigStr ( int  iConfigId,
string  sSectionName,
string  sFieldName,
string  sValue 
)

Write a string into the config.

Parameters:
[in]iConfigIdThe ID of the config
[in]sSectionNameThe section name
[in]sFieldNameThe field name
[in]sValueThe string
Returns:
Succeed or not