Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
AppConfig Class Reference

Manages configuration read and write of an application. More...

Inheritance diagram for AppConfig:
OfConfig

Public Member Functions

void init_config (AppObject &app, int argc, char **argv, const CoreString &filename="", const bool &check_migration_config_file=false, const bool &force_migration=false)
 
bool read (const CoreString &filename="")
 Read the config file.
 
bool save (const CoreString &filename="")
 Save the config file if possible. Will not save it if config_readonly yes option has been specified on command line.
 
bool write (const CoreString &filename)
 Save the config file to the specified location. If empty, won't save anything.
 
unsigned int get_value_count (const CoreString &entry_name) const
 
void reset_entry (const CoreString &entry_name)
 
bool is_value_bool (const CoreString &entry_name, const unsigned int &index=0) const
 
bool is_value_int (const CoreString &entry_name, const unsigned int &index=0) const
 
bool is_value_double (const CoreString &entry_name, const unsigned int &index=0) const
 
bool is_value_string (const CoreString &entry_name, const unsigned int &index=0) const
 
bool is_value_local (const CoreString &entry_name) const
 
bool get_bool (const CoreString &entry_name, const unsigned int &index=0) const
 
int get_int (const CoreString &entry_name, const unsigned int &index=0) const
 
double get_double (const CoreString &entry_name, const unsigned int &index=0) const
 
CoreString get_string (const CoreString &entry_name, const unsigned int &index=0) const
 
void set_bool (const CoreString &entry_name, const bool &value, const unsigned int &index=0)
 
void set_int (const CoreString &entry_name, const int &value, const unsigned int &index=0)
 
void set_double (const CoreString &entry_name, const double &value, const unsigned int &index=0)
 
void set_string (const CoreString &entry_name, const CoreString &value, const unsigned int &index=0)
 
void set_local_bool (const CoreString &entry_name, const bool &value, const unsigned int &index=0)
 
void set_local_int (const CoreString &entry_name, const int &value, const unsigned int &index=0)
 
void set_local_double (const CoreString &entry_name, const double &value, const unsigned int &index=0)
 
void set_local_string (const CoreString &entry_name, const CoreString &value, const unsigned int &index=0)
 
ParserEntryget_entry (const CoreString &entry_name) const
 
ParserEntryget_file_entry (const CoreString &entry_name)
 
ParserEntrycreate_file_entry (const CoreString &entry_name)
 
void set_flavor (AppBase::Flavor flavor)
 
ParserEntryget_flavored_file_entry (const CoreString &entry_name)
 
ParserEntrycreate_flavored_file_entry (const CoreString &entry_name)
 
bool is_built_in (const CoreString &entry_name) const
 
const CoreArray< CoreString > & get_entry_names () const
 
CoreString get_config_file_full_path ()
 
CoreString get_app_prefs_default_filename () const
 
void post_load_config (AppObject &app)
 
unsigned int get_value_type (const CoreString &entry_name) const
 
CoreArray< CoreStringget_entry_names ()
 
void set_config_readonly (const bool &value)
 
bool is_config_readonly ()
 

Static Public Member Functions

static CoreString get_app_prefs_root_dir ()
 
static CoreString get_app_prefs_path ()
 

Detailed Description

Manages configuration read and write of an application.

Member Function Documentation

bool AppConfig::read ( const CoreString filename = "")

Read the config file.

Parameters
[in]filenameconfig location
Returns
true if success, false otherwise
bool AppConfig::save ( const CoreString filename = "")

Save the config file if possible. Will not save it if config_readonly yes option has been specified on command line.

Parameters
[in]filenamewhere to save the config. If empty, will use the last save location
Returns
true if success, false otherwise
bool AppConfig::write ( const CoreString filename)

Save the config file to the specified location. If empty, won't save anything.

Returns
true if success, false otherwise