Typedefs | Enumerations | Functions

OrxConfig

Typedefs

typedef orxBOOL(orxFASTCALL * orxCONFIG_SAVE_FUNCTION )(const orxSTRING _zSectionName, const orxSTRING _zKeyName, const orxSTRING _zFileName, orxBOOL _bUseEncryption)

Enumerations

enum  orxCONFIG_EVENT {
  orxCONFIG_EVENT_RELOAD_START = 0, orxCONFIG_EVENT_RELOAD_STOP, orxCONFIG_EVENT_INVALID_TYPE_ACCESS, orxCONFIG_EVENT_NUMBER,
  orxCONFIG_EVENT_NONE = orxENUM_NONE
}

Functions

orxDLLAPI orxSTATUS orxFASTCALL orxConfig_Clear ()
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_ClearSection (const orxSTRING _zSectionName)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_ClearValue (const orxSTRING _zKey)
orxDLLAPI orxSTRING orxFASTCALL orxConfig_DuplicateRawValue (const orxSTRING _zKey)
orxDLLAPI void orxFASTCALL orxConfig_Exit ()
orxDLLAPI orxBOOL orxFASTCALL orxConfig_GetBool (const orxSTRING _zKey)
orxDLLAPI const orxSTRING
orxFASTCALL 
orxConfig_GetCurrentSection ()
orxDLLAPI orxFLOAT orxFASTCALL orxConfig_GetFloat (const orxSTRING _zKey)
orxDLLAPI const orxSTRING
orxFASTCALL 
orxConfig_GetKey (orxS32 _s32KeyIndex)
orxDLLAPI orxS32 orxFASTCALL orxConfig_GetKeyCounter ()
orxDLLAPI orxBOOL orxFASTCALL orxConfig_GetListBool (const orxSTRING _zKey, orxS32 _s32ListIndex)
orxDLLAPI orxS32 orxFASTCALL orxConfig_GetListCounter (const orxSTRING _zKey)
orxDLLAPI orxFLOAT orxFASTCALL orxConfig_GetListFloat (const orxSTRING _zKey, orxS32 _s32ListIndex)
orxDLLAPI orxS32 orxFASTCALL orxConfig_GetListS32 (const orxSTRING _zKey, orxS32 _s32ListIndex)
orxDLLAPI const orxSTRING
orxFASTCALL 
orxConfig_GetListString (const orxSTRING _zKey, orxS32 _s32ListIndex)
orxDLLAPI orxU32 orxFASTCALL orxConfig_GetListU32 (const orxSTRING _zKey, orxS32 _s32ListIndex)
orxDLLAPI orxVECTOR *orxFASTCALL orxConfig_GetListVector (const orxSTRING _zKey, orxS32 _s32ListIndex, orxVECTOR *_pvVector)
orxDLLAPI const orxSTRING
orxFASTCALL 
orxConfig_GetMainFileName ()
orxDLLAPI const orxSTRING
orxFASTCALL 
orxConfig_GetParent (const orxSTRING _zSectionName)
orxDLLAPI orxS32 orxFASTCALL orxConfig_GetS32 (const orxSTRING _zKey)
orxDLLAPI const orxSTRING
orxFASTCALL 
orxConfig_GetSection (orxS32 _s32SectionIndex)
orxDLLAPI orxS32 orxFASTCALL orxConfig_GetSectionCounter ()
orxDLLAPI const orxSTRING
orxFASTCALL 
orxConfig_GetString (const orxSTRING _zKey)
orxDLLAPI orxU32 orxFASTCALL orxConfig_GetU32 (const orxSTRING _zKey)
orxDLLAPI orxVECTOR *orxFASTCALL orxConfig_GetVector (const orxSTRING _zKey, orxVECTOR *_pvVector)
orxDLLAPI orxBOOL orxFASTCALL orxConfig_HasSection (const orxSTRING _zSectionName)
orxDLLAPI orxBOOL orxFASTCALL orxConfig_HasValue (const orxSTRING _zKey)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_Init ()
orxDLLAPI orxBOOL orxFASTCALL orxConfig_IsInheritedValue (const orxSTRING _zKey)
orxDLLAPI orxBOOL orxFASTCALL orxConfig_IsList (const orxSTRING _zKey)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_Load (const orxSTRING _zFileName)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_PopSection ()
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_ProtectSection (const orxSTRING _zSectionName, orxBOOL _bProtect)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_PushSection (const orxSTRING _zSectionName)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_ReloadHistory ()
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_RenameSection (const orxSTRING _zSectionName, const orxSTRING _zNewSectionName)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_Save (const orxSTRING _zFileName, orxBOOL _bUseEncryption, const orxCONFIG_SAVE_FUNCTION _pfnSaveCallback)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SelectSection (const orxSTRING _zSectionName)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetBaseName (const orxSTRING _zBaseName)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetBool (const orxSTRING _zKey, orxBOOL _bValue)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetEncryptionKey (const orxSTRING _zEncryptionKey)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetFloat (const orxSTRING _zKey, orxFLOAT _fValue)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetParent (const orxSTRING _zSectionName, const orxSTRING _zParentName)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetS32 (const orxSTRING _zKey, orxS32 _s32Value)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetString (const orxSTRING _zKey, const orxSTRING _zValue)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetStringBlock (const orxSTRING _zKey, const orxSTRING _zValue)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetStringList (const orxSTRING _zKey, const orxSTRING _azValue[], orxU32 _u32Number)
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetU32 (const orxSTRING _zKey, orxU32 _u32Value)
orxDLLAPI void orxFASTCALL orxConfig_Setup ()
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetVector (const orxSTRING _zKey, const orxVECTOR *_pvValue)

Detailed Description

Config module Module that handles configuration files


Typedef Documentation

typedef orxBOOL(orxFASTCALL * orxCONFIG_SAVE_FUNCTION)(const orxSTRING _zSectionName, const orxSTRING _zKeyName, const orxSTRING _zFileName, orxBOOL _bUseEncryption)

Config callback function type to use with save function

Definition at line 68 of file orxConfig.h.


Enumeration Type Documentation

Event enum

Enumerator:
orxCONFIG_EVENT_RELOAD_START 

Event sent when reloading config starts

orxCONFIG_EVENT_RELOAD_STOP 

Event sent when reloading config stops

orxCONFIG_EVENT_INVALID_TYPE_ACCESS 

Event sent when accessing a value with an invalid type getter

orxCONFIG_EVENT_NUMBER 
orxCONFIG_EVENT_NONE 

Definition at line 54 of file orxConfig.h.


Function Documentation

orxDLLAPI orxSTATUS orxFASTCALL orxConfig_Clear (  )

Clears all config info

Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_ClearSection ( const orxSTRING  _zSectionName )

Clears section

Parameters:
[in]_zSectionNameSection name to clear
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_ClearValue ( const orxSTRING  _zKey )

Clears a value from current selected section

Parameters:
[in]_zKeyKey name
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTRING orxFASTCALL orxConfig_DuplicateRawValue ( const orxSTRING  _zKey )

Duplicates a raw value (string) from config

Parameters:
[in]_zKeyKey name
Returns:
The value. If non-null, needs to be deleted by the caller with orxString_Delete()
orxDLLAPI void orxFASTCALL orxConfig_Exit (  )

Exits from the Config Module

orxDLLAPI orxBOOL orxFASTCALL orxConfig_GetBool ( const orxSTRING  _zKey )

Reads a boolean value from config (will take a random value if a list is provided for this key)

Parameters:
[in]_zKeyKey name
Returns:
The value
orxDLLAPI const orxSTRING orxFASTCALL orxConfig_GetCurrentSection (  )

Gets current working section

Returns:
Current selected section
orxDLLAPI orxFLOAT orxFASTCALL orxConfig_GetFloat ( const orxSTRING  _zKey )

Reads a float value from config (will take a random value if a list is provided for this key)

Parameters:
[in]_zKeyKey name
Returns:
The value
orxDLLAPI const orxSTRING orxFASTCALL orxConfig_GetKey ( orxS32  _s32KeyIndex )

Gets key for the current section at the given index

Parameters:
[in]_s32KeyIndexIndex of the desired key
Returns:
orxSTRING if exist, orxSTRING_EMPTY otherwise
orxDLLAPI orxS32 orxFASTCALL orxConfig_GetKeyCounter (  )

Gets key counter of the current section

Returns:
Key counter of the current section if valid, 0 otherwise
orxDLLAPI orxBOOL orxFASTCALL orxConfig_GetListBool ( const orxSTRING  _zKey,
orxS32  _s32ListIndex 
)

Reads a boolean value from config list

Parameters:
[in]_zKeyKey name
[in]_s32ListIndexIndex of desired item in list / -1 for random
Returns:
The value
orxDLLAPI orxS32 orxFASTCALL orxConfig_GetListCounter ( const orxSTRING  _zKey )

Gets list counter for a given key

Parameters:
[in]_zKeyKey name
Returns:
List counter if it's a valid list, 0 otherwise
orxDLLAPI orxFLOAT orxFASTCALL orxConfig_GetListFloat ( const orxSTRING  _zKey,
orxS32  _s32ListIndex 
)

Reads a float value from config list

Parameters:
[in]_zKeyKey name
[in]_s32ListIndexIndex of desired item in list / -1 for random
Returns:
The value
orxDLLAPI orxS32 orxFASTCALL orxConfig_GetListS32 ( const orxSTRING  _zKey,
orxS32  _s32ListIndex 
)

Reads a signed integer value from config list

Parameters:
[in]_zKeyKey name
[in]_s32ListIndexIndex of desired item in list / -1 for random
Returns:
The value
orxDLLAPI const orxSTRING orxFASTCALL orxConfig_GetListString ( const orxSTRING  _zKey,
orxS32  _s32ListIndex 
)

Reads a string value from config list

Parameters:
[in]_zKeyKey name
[in]_s32ListIndexIndex of desired item in list / -1 for random
Returns:
The value
orxDLLAPI orxU32 orxFASTCALL orxConfig_GetListU32 ( const orxSTRING  _zKey,
orxS32  _s32ListIndex 
)

Reads an unsigned integer value from config list

Parameters:
[in]_zKeyKey name
[in]_s32ListIndexIndex of desired item in list / -1 for random
Returns:
The value
orxDLLAPI orxVECTOR* orxFASTCALL orxConfig_GetListVector ( const orxSTRING  _zKey,
orxS32  _s32ListIndex,
orxVECTOR _pvVector 
)

Reads a vector value from config list

Parameters:
[in]_zKeyKey name
[in]_s32ListIndexIndex of desired item in list / -1 for random
[out]_pvVectorStorage for vector value
Returns:
The value
orxDLLAPI const orxSTRING orxFASTCALL orxConfig_GetMainFileName (  )

Gets config main file name

Returns:
Config main file name / orxSTRING_EMPTY
orxDLLAPI const orxSTRING orxFASTCALL orxConfig_GetParent ( const orxSTRING  _zSectionName )

Gets a section's parent

Parameters:
[in]_zSectionNameConcerned section, if the section doesn't exist, it will be created
Returns:
Section's parent name / orxNULL
orxDLLAPI orxS32 orxFASTCALL orxConfig_GetS32 ( const orxSTRING  _zKey )

Reads a signed integer value from config (will take a random value if a list is provided for this key)

Parameters:
[in]_zKeyKey name
Returns:
The value
orxDLLAPI const orxSTRING orxFASTCALL orxConfig_GetSection ( orxS32  _s32SectionIndex )

Gets section at the given index

Parameters:
[in]_s32SectionIndexIndex of the desired section
Returns:
orxSTRING if exist, orxSTRING_EMPTY otherwise
orxDLLAPI orxS32 orxFASTCALL orxConfig_GetSectionCounter (  )

Gets section counter

Returns:
Section counter
orxDLLAPI const orxSTRING orxFASTCALL orxConfig_GetString ( const orxSTRING  _zKey )

Reads a string value from config (will take a random value if a list is provided for this key)

Parameters:
[in]_zKeyKey name
Returns:
The value
orxDLLAPI orxU32 orxFASTCALL orxConfig_GetU32 ( const orxSTRING  _zKey )

Reads an unsigned integer value from config (will take a random value if a list is provided for this key)

Parameters:
[in]_zKeyKey name
Returns:
The value
orxDLLAPI orxVECTOR* orxFASTCALL orxConfig_GetVector ( const orxSTRING  _zKey,
orxVECTOR _pvVector 
)

Reads a vector value from config (will take a random value if a list is provided for this key)

Parameters:
[in]_zKeyKey name
[out]_pvVectorStorage for vector value
Returns:
The value
orxDLLAPI orxBOOL orxFASTCALL orxConfig_HasSection ( const orxSTRING  _zSectionName )

Has section for the given section name?

Parameters:
[in]_zSectionNameSection name
Returns:
orxTRUE / orxFALSE
orxDLLAPI orxBOOL orxFASTCALL orxConfig_HasValue ( const orxSTRING  _zKey )

Has specified value for the given key?

Parameters:
[in]_zKeyKey name
Returns:
orxTRUE / orxFALSE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_Init (  )

Initializes the Config Module

Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxBOOL orxFASTCALL orxConfig_IsInheritedValue ( const orxSTRING  _zKey )

Is this value inherited from another one?

Parameters:
[in]_zKeyKey name
Returns:
orxTRUE / orxFALSE
orxDLLAPI orxBOOL orxFASTCALL orxConfig_IsList ( const orxSTRING  _zKey )

Is value a list for the given key?

Parameters:
[in]_zKeyKey name
Returns:
orxTRUE / orxFALSE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_Load ( const orxSTRING  _zFileName )

Loads config file from source

Parameters:
[in]_zFileNameFile name
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_PopSection (  )

Pops last section from section stack

Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_ProtectSection ( const orxSTRING  _zSectionName,
orxBOOL  _bProtect 
)

Protects/unprotects a section from deletion (content might still be changed or deleted, but the section itself will resist delete/clear calls)

Parameters:
[in]_zSectionNameSection name to protect
[in]_bProtectorxTRUE for protecting the section, orxFALSE to remove the protection
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_PushSection ( const orxSTRING  _zSectionName )

Pushes a section (storing the current one on section stack)

Parameters:
[in]_zSectionNameSection name to push
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_ReloadHistory (  )

Reloads config files from history

Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_RenameSection ( const orxSTRING  _zSectionName,
const orxSTRING  _zNewSectionName 
)

Renames a section

Parameters:
[in]_zSectionNameSection to rename
[in]_zNewSectionNameNew name for the section
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_Save ( const orxSTRING  _zFileName,
orxBOOL  _bUseEncryption,
const orxCONFIG_SAVE_FUNCTION  _pfnSaveCallback 
)

Writes config to given file. Will overwrite any existing file, including all comments.

Parameters:
[in]_zFileNameFile name, if null or empty the default file name will be used
[in]_bUseEncryptionUse file encryption to make it human non-readable?
[in]_pfnSaveCallbackCallback used to filter section/key to save. If NULL is passed, all section/keys will be saved
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SelectSection ( const orxSTRING  _zSectionName )

Selects current working section

Parameters:
[in]_zSectionNameSection name to select
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetBaseName ( const orxSTRING  _zBaseName )

Sets config base name

Parameters:
[in]_zBaseNameBase name used for default config file
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetBool ( const orxSTRING  _zKey,
orxBOOL  _bValue 
)

Writes a boolean value to config

Parameters:
[in]_zKeyKey name
[in]_bValueValue
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetEncryptionKey ( const orxSTRING  _zEncryptionKey )

Sets encryption key

Parameters:
[in]_zEncryptionKeyEncryption key to use, orxNULL to clear
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetFloat ( const orxSTRING  _zKey,
orxFLOAT  _fValue 
)

Writes a float value to config

Parameters:
[in]_zKeyKey name
[in]_fValueValue
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetParent ( const orxSTRING  _zSectionName,
const orxSTRING  _zParentName 
)

Sets a section's parent

Parameters:
[in]_zSectionNameConcerned section, if the section doesn't exist, it will be created
[in]_zParentNameParent section's name, if the section doesn't exist, it will be created, if orxNULL is provided, the former parent will be erased
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetS32 ( const orxSTRING  _zKey,
orxS32  _s32Value 
)

Writes a signed integer value to config

Parameters:
[in]_zKeyKey name
[in]_s32ValueValue
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetString ( const orxSTRING  _zKey,
const orxSTRING  _zValue 
)

Writes a string value to config

Parameters:
[in]_zKeyKey name
[in]_zValueValue
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetStringBlock ( const orxSTRING  _zKey,
const orxSTRING  _zValue 
)

Writes a string value to config, in block mode

Parameters:
[in]_zKeyKey name
[in]_zValueValue to write in block mode
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetStringList ( const orxSTRING  _zKey,
const orxSTRING  _azValue[],
orxU32  _u32Number 
)

Writes a list of string values to config

Parameters:
[in]_zKeyKey name
[in]_azValueValues
[in]_u32NumberNumber of values
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetU32 ( const orxSTRING  _zKey,
orxU32  _u32Value 
)

Writes an unsigned integer value to config

Parameters:
[in]_zKeyKey name
[in]_u32ValueValue
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI void orxFASTCALL orxConfig_Setup (  )

Config module setup

orxDLLAPI orxSTATUS orxFASTCALL orxConfig_SetVector ( const orxSTRING  _zKey,
const orxVECTOR _pvValue 
)

Writes a vector value to config

Parameters:
[in]_zKeyKey name
[in]_pvValueValue
Returns:
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Generated for orx by doxygen 1.5.6