Typedefs | |
typedef struct __tag_config | GF_Config |
Functions | |
GF_Config * | gf_cfg_init (const char *file, Bool *new_cfg) |
configuration file initialization | |
GF_Config * | gf_cfg_new (const char *filePath, const char *fileName) |
configuration file constructor | |
GF_Config * | gf_cfg_force_new (const char *filePath, const char *fileName) |
alternative configuration file constructor | |
void | gf_cfg_del (GF_Config *cfgFile) |
configuration file destructor | |
void | gf_cfg_remove (GF_Config *cfgFile) |
configuration file destructor | |
GF_Err | gf_cfg_save (GF_Config *iniFile) |
configuration saving | |
const char * | gf_cfg_get_key (GF_Config *cfgFile, const char *secName, const char *keyName) |
key value query | |
const char * | gf_cfg_get_ikey (GF_Config *cfgFile, const char *secName, const char *keyName) |
key value query ignoring case | |
GF_Err | gf_cfg_set_key (GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue) |
key value update | |
u32 | gf_cfg_get_section_count (GF_Config *cfgFile) |
section count query | |
const char * | gf_cfg_get_section_name (GF_Config *cfgFile, u32 secIndex) |
section name query | |
u32 | gf_cfg_get_key_count (GF_Config *cfgFile, const char *secName) |
key count query | |
const char * | gf_cfg_get_key_name (GF_Config *cfgFile, const char *secName, u32 keyIndex) |
key count query | |
GF_Err | gf_cfg_insert_key (GF_Config *cfgFile, const char *secName, const char *keyName, const char *keyValue, u32 index) |
key insertion | |
void | gf_cfg_del_section (GF_Config *cfgFile, const char *secName) |
section destrouction | |
const char * | gf_cfg_get_sub_key (GF_Config *iniFile, 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) |
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.
fileName | name of the configuration file, or NULL for default file | |
new_cfg | Boolean set to true if a new configuration file has been created |
GF_Config* gf_cfg_new | ( | const char * | filePath, | |
const char * | fileName | |||
) |
Constructs a configuration file.
filePath | directory the file is located in | |
fileName | name of the configuration file |
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
filePath | directory the file is located in | |
fileName | name of the configuration file |
void gf_cfg_del | ( | GF_Config * | cfgFile | ) |
Destroys the configuration file and saves it if needed.
cfgFile | the target configuration file |
void gf_cfg_remove | ( | GF_Config * | cfgFile | ) |
Destroys the configuration file and removes the file from disk.
cfgFile | the target configuration file |
GF_Err gf_cfg_save | ( | GF_Config * | iniFile | ) |
Saves the configuration file if modified.
cfgFile | the target configuration file |
const char* gf_cfg_get_key | ( | GF_Config * | cfgFile, | |
const char * | secName, | |||
const char * | keyName | |||
) |
Gets a key value from its section and name.
cfgFile | the target configuration file | |
secName | the desired key parent section name | |
keyName | the desired key name |
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.
cfgFile | the target configuration file | |
secName | the desired key parent section name (case ignored) | |
keyName | the desired key name (case ignored) |
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.
cfgFile | the target configuration file | |
secName | the desired key parent section name | |
keyName | the desired key name | |
keyValue | the desired key value |
u32 gf_cfg_get_section_count | ( | GF_Config * | cfgFile | ) |
Gets the number of sections in the configuration file
cfgFile | the target configuration file |
const char* gf_cfg_get_section_name | ( | GF_Config * | cfgFile, | |
u32 | secIndex | |||
) |
Gets a section name based on its index
cfgFile | the target configuration file | |
secIndex | 0-based index of the section to query |
u32 gf_cfg_get_key_count | ( | GF_Config * | cfgFile, | |
const char * | secName | |||
) |
Gets the number of keys in a section of the configuration file
cfgFile | the target configuration file | |
secName | the target section |
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
cfgFile | the target configuration file | |
secName | the target section | |
keyIndex | 0-based index of the key in the section |
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
cfgFile | the target configuration file | |
secName | the target section | |
keyName | the name of the target key | |
keyValue | the value for the new key | |
index | the 0-based index position of the new key |
void gf_cfg_del_section | ( | GF_Config * | cfgFile, | |
const char * | secName | |||
) |
Removes all entries in the given section
cfgFile | the target configuration file | |
secName | the target section |
const char* gf_cfg_get_sub_key | ( | GF_Config * | iniFile, | |
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
cfgFile | the target configuration file | |
secName | the target section | |
keyName | the name of the target key | |
sub_index | the 0-based index position of the sub key |
char* gf_cfg_get_filename | ( | GF_Config * | iniFile | ) |
Get the full filename associated with this config file The caller is responsible for freeing memory
iniFile | The Configuration |
GF_Err gf_cfg_set_filename | ( | GF_Config * | iniFile, | |
const char * | fileName | |||
) |
Set the full filename associated with this config file
iniFile | The Configuration | |
fileName | new filename for the config |