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

◆ write() [4/4]

template<typename type_t >
void xtd::configuration::file_settings::write ( const xtd::string section,
const xtd::string key,
type_t &&  value 
)
inline

Writes a specified value for specified key in the specified section.

Parameters
sectionThe section where the key is write.
keyThe key used to write a value.
valueA string to write.
Remarks
To write permanently use the xtd::configuration::file_settings::save method.
Examples
The following example shows how to create xtd::configuration::file_settings and use xtd::configuration::file_settings::reset, xtd::configuration::file_settings::write and xtd::configuration::file_settings::save methods.
auto file = file_settings {"my_app.ini"};
file.reset();
file.write("main", "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.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:
[main]
quit_application_on_main_form_closed = true
[pictures "Menu"]
file_open = resources/symbolic_open.png
file_save = resources/symbolic_save.png