GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
configuration

Configuration File object. More...

+ Collaboration diagram for configuration:

Functions

GF_Config * gf_cfg_init (const char *file, Bool *new_cfg)
 configuration file initialization More...
 
GF_Config * gf_cfg_new (const char *filePath, const char *fileName)
 configuration file constructor More...
 
GF_Config * gf_cfg_force_new (const char *filePath, const char *fileName)
 alternative configuration file constructor More...
 
void gf_cfg_del (GF_Config *cfgFile)
 configuration file destructor More...
 
void gf_cfg_remove (GF_Config *cfgFile)
 configuration file destructor More...
 
GF_Err gf_cfg_save (GF_Config *cfgFile)
 configuration saving More...
 
const char * gf_cfg_get_key (GF_Config *cfgFile, const char *secName, const char *keyName)
 key value query More...
 
const char * gf_cfg_get_ikey (GF_Config *cfgFile, const char *secName, const char *keyName)
 key value query ignoring case More...
 
GF_Err gf_cfg_set_key (GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue)
 key value update More...
 
u32 gf_cfg_get_section_count (GF_Config *cfgFile)
 section count query More...
 
const char * gf_cfg_get_section_name (GF_Config *cfgFile, u32 secIndex)
 section name query More...
 
u32 gf_cfg_get_key_count (GF_Config *cfgFile, const char *secName)
 key count query More...
 
const char * gf_cfg_get_key_name (GF_Config *cfgFile, const char *secName, u32 keyIndex)
 key count query More...
 
GF_Err gf_cfg_insert_key (GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue, u32 index)
 key insertion More...
 
void gf_cfg_del_section (GF_Config *cfgFile, const char *secName)
 section destrouction More...
 
const char * gf_cfg_get_sub_key (GF_Config *cfgFile, const char *secName, const char *keyName, u32 sub_index)
 
char * gf_cfg_get_filename (GF_Config *iniFile)
 
GF_Err gf_cfg_set_filename (GF_Config *iniFile, const char *fileName)
 

Detailed Description

    This section documents the configuration file object of the GPAC framework.
    This file is formatted as the INI file mode of WIN32 in sections and keys.\n
Note
For more information on the GPAC configuration file itself, please refer to the GPAC configuration help provided with GPAC.

Function Documentation

GF_Config* gf_cfg_init ( const char *  file,
Bool new_cfg 
)

Constructs a configuration file from fileName. if fileName is NULL, the default GPAC configuration file is loaded. If no configuration file is found, a default configuration file is created with the proper module directory, font directory and other default options.

Parameters
filename of the configuration file, or NULL for default file
new_cfgBoolean set to true if a new configuration file has been created
Returns
the configuration file object, NULL if the file could not be created

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Config* gf_cfg_new ( const char *  filePath,
const char *  fileName 
)

Constructs a configuration file.

Parameters
filePathdirectory the file is located in
fileNamename of the configuration file
Returns
the configuration file object, NULL if the file does not exist

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Config* gf_cfg_force_new ( const char *  filePath,
const char *  fileName 
)

Constructs a configuration file. If file does not exist, configuration will be still created

Parameters
filePathdirectory the file is located in
fileNamename of the configuration file
Returns
the configuration file object, never NULL, even if file does not exist

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_cfg_del ( GF_Config *  cfgFile)

Destroys the configuration file and saves it if needed.

Parameters
cfgFilethe target configuration file

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gf_cfg_remove ( GF_Config *  cfgFile)

Destroys the configuration file and removes the file from disk.

Parameters
cfgFilethe target configuration file

+ Here is the call graph for this function:

GF_Err gf_cfg_save ( GF_Config *  cfgFile)

Saves the configuration file if modified.

Parameters
cfgFilethe target configuration file

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* gf_cfg_get_key ( GF_Config *  cfgFile,
const char *  secName,
const char *  keyName 
)

Gets a key value from its section and name.

Parameters
cfgFilethe target configuration file
secNamethe desired key parent section name
keyNamethe desired key name
Returns
the desired key value if found, NULL otherwise.

+ Here is the call graph for this function:

const char* gf_cfg_get_ikey ( GF_Config *  cfgFile,
const char *  secName,
const char *  keyName 
)

Gets a key value from its section and name. Comparison is performed while ignoring case.

Parameters
cfgFilethe target configuration file
secNamethe desired key parent section name (case ignored)
keyNamethe desired key name (case ignored)
Returns
the desired key value if found, NULL otherwise.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_cfg_set_key ( GF_Config *  cfgFile,
const char *  secName,
const char *  keyName,
const char *  keyValue 
)

Sets a key value from its section and name.

Parameters
cfgFilethe target configuration file
secNamethe desired key parent section name
keyNamethe desired key name
keyValuethe desired key value
Note
this will also create both section and key if they are not found in the configuration file

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 gf_cfg_get_section_count ( GF_Config *  cfgFile)

Gets the number of sections in the configuration file

Parameters
cfgFilethe target configuration file
Returns
the number of sections

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* gf_cfg_get_section_name ( GF_Config *  cfgFile,
u32  secIndex 
)

Gets a section name based on its index

Parameters
cfgFilethe target configuration file
secIndex0-based index of the section to query
Returns
the section name if found, NULL otherwise

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 gf_cfg_get_key_count ( GF_Config *  cfgFile,
const char *  secName 
)

Gets the number of keys in a section of the configuration file

Parameters
cfgFilethe target configuration file
secNamethe target section
Returns
the number of keys in the section

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* gf_cfg_get_key_name ( GF_Config *  cfgFile,
const char *  secName,
u32  keyIndex 
)

Gets the number of keys in a section of the configuration file

Parameters
cfgFilethe target configuration file
secNamethe target section
keyIndex0-based index of the key in the section
Returns
the key name if found, NULL otherwise

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_cfg_insert_key ( GF_Config *  cfgFile,
const char *  secName,
const char *  keyName,
const char *  keyValue,
u32  index 
)

Inserts a new key in a given section. Returns an error if a key with the given name already exists in the section

Parameters
cfgFilethe target configuration file
secNamethe target section
keyNamethe name of the target key
keyValuethe value for the new key
indexthe 0-based index position of the new key

+ Here is the call graph for this function:

void gf_cfg_del_section ( GF_Config *  cfgFile,
const char *  secName 
)

Removes all entries in the given section

Parameters
cfgFilethe target configuration file
secNamethe target section

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* gf_cfg_get_sub_key ( GF_Config *  cfgFile,
const char *  secName,
const char *  keyName,
u32  sub_index 
)

get a sub key (separator is ':') in a given key in a given section. Returns an error if the key does not exist

Parameters
cfgFilethe target configuration file
secNamethe target section
keyNamethe name of the target key
sub_indexthe 0-based index position of the sub key

+ Here is the call graph for this function:

char* gf_cfg_get_filename ( GF_Config *  iniFile)

Get the full filename associated with this config file The caller is responsible for freeing memory

Parameters
iniFileThe Configuration
Returns
a newly allocated filename

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_Err gf_cfg_set_filename ( GF_Config *  iniFile,
const char *  fileName 
)

Set the full filename associated with this config file

Parameters
iniFileThe Configuration
fileNamenew filename for the config
Returns
erroro code

+ Here is the call graph for this function:

+ Here is the caller graph for this function: