Settings storage

Imagines setting system is a convenient system for storing application settings in an XML file. An application can both set and get a settings value. If an application is using any of the "get" functions requesting a non existent setting, then the setting will be automaticaly created using the default value. This makes the system very robust as a deleter file, or even part of a file, can be recreated by the setting sytem system. An application also has the abillity to provide comments to make the settings file easier for humans to read.


boolean imagine_setting_boolean_get(const char *setting, boolean default_value, const char *comment);

Description: Get boolean setting. The function will return default_value if the setting is not available, and create the setting in the setting li


void imagine_setting_boolean_set(const char *setting, boolean value, const char *comment);

Description: set boolean setting


int imagine_setting_integer_get(const char *setting, int default_value, const char *comment);

Description: get uint setting


void imagine_setting_integer_set(const char *setting, int value, const char *comment);

Description: set uint setting


double imagine_setting_double_get(const char *setting, double default_value, const char *comment);

Description: get double setting


void imagine_setting_double_set(const char *setting, double value, const char *comment);

Description: set double setting


char *imagine_setting_text_get(const char *setting, char *default_text, const char *comment);

Description: get text setting


void imagine_setting_text_set(const char *setting, char *text, const char *comment);

Description: set text setting


void imagine_settings_save(const char *file_name);

Description: saves all settings to a file


void imagine_settings_load(const char *file_name);

Description: loads all settings from a file


boolean imagine_setting_test(const char *setting);

Description: Test if a setting exists