xtd 0.2.0
Loading...
Searching...
No Matches

◆ remove() [1/2]

void xtd::configuration::file_settings::remove ( const xtd::string key)
noexcept

Removes the specified key from the global section.

Parameters
keyThe key to remove from the global section.
Remarks
To write permanently use the xtd::configuration::file_settings::save method.
This method is equivalent to call xtd::configuration::file_settings::remove (const xtd::string& section) with xtd::string::empty_string paramreter.

Removes the specified key from the specified section.

Parameters
sectionThe section where the key is removed.
keyThe key to remove from the specified section.
Remarks
To write permanently use the xtd::configuration::file_settings::save method.
Use xtd::string::empty_string paramreter to remove key of the global section.
Examples
The following example shows how to create xtd::configuration::file_settings and use xtd::configuration::file_settings::reset, xtd::configuration::file_settings::write, xtd::configuration::file_settings::remove and xtd::configuration::file_settings::save methods.
auto file = file_settings {"my_app.ini"};
file.reset();
file.write(quit_application_on_main_form_closed", true);
file.write("pictures \"Menu\"", "file_open", "resources/symbolic_open.png");
file.write("pictures \"Menu\"", "file_save", "resources/symbolic_save.png");
file.remove("quit_application_on_main_form_closed");
file.save();
void reset()
Reset current settings.
Represents an object for storing and retrieving configuration information using text files in INI for...
Definition file_settings.h:32
my_app.ini:
[pictures "Menu"]
file_open = resources/symbolic_open.png
file_save = resources/symbolic_save.png