1 #ifndef INI_CONFIGURATOR_CLASS
2 #define INI_CONFIGURATOR_CLASS
19 #if defined(__UNIX__) || defined(__GNU_WINDOWS__)
113 #if defined(__UNIX__) || defined(__GNU_WINDOWS__)
130 void read_ini_file();
132 void write_ini_file();
Provides a dynamically resizable ASCII character string.
Provides a base class for configuration repositories.
treatment_of_defaults behavior() const
observes the behavior chosen for the load() function.
Supports a configurator-based interface on text initialization files.
DEFINE_CLASS_NAME("ini_configurator")
virtual bool section_exists(const basis::astring §ion)
returns true if the "section" was found in the file.
virtual bool delete_entry(const basis::astring §ion, const basis::astring &entry)
removes the entry specified by the "section" and "entry" name.
file_location_default
chooses where the ini file is located if no path to it is provided.
@ OS_DIRECTORY
config files live in operating system directory.
@ APPLICATION_DIRECTORY
config files live with application.
@ ALL_USERS_DIRECTORY
config files live in the "all users" account.
void add_spaces(bool add_them)
virtual ~ini_configurator()
virtual void sections(structures::string_array &list)
retrieves the section names into "list".
basis::astring name() const
observes the name of the file used for ini entries.
virtual bool get(const basis::astring §ion, const basis::astring &entry, basis::astring &found)
implements the configurator retrieval function.
virtual bool delete_section(const basis::astring §ion)
removes the entire "section" specified.
virtual bool put_section(const basis::astring §ion, const structures::string_table &info)
writes a table called "info" into the "section" in the INI file.
virtual bool get_section(const basis::astring §ion, structures::string_table &info)
reads the entire "section" into a table called "info".
ini_configurator(const basis::astring &ini_filename, treatment_of_defaults behavior=RETURN_ONLY, file_location_default where=ALL_USERS_DIRECTORY)
creates an ini_configurator that stores entries into "ini_filename".
virtual bool put(const basis::astring §ion, const basis::astring &entry, const basis::astring &to_store)
implements the configurator storage function.
void refresh()
useful mainly on unix/linux, where the file is parsed and held in memory.
Parses strings in the fairly well-known INI file format.
Provides operations commonly needed on file names.
An array of strings with some additional helpful methods.
Provides a symbol_table that holds strings as the content.
Support for unicode builds.