Skip to content

Commit 627866a

Browse files
committed
Review code
1 parent c155a8a commit 627866a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/xtd.forms/include/xtd/settings.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace xtd {
1616
/// xtd::forms
1717
/// @par Library
1818
/// xtd.forms
19-
/// @ingroup xtd_forms components
19+
/// @ingroup xtd_core system components
2020
/// @remarks On Windows settings are stored in registry with "HKEY_CURRENT_USER\Software\company_name\product_name" key or if no Company name "\HKEY_CURRENT_USER\Software\Product Name\Product Name" key.
2121
/// @remarks On macos settings are stored in "~/Library/Preferences/product_name Preferences" file.
2222
/// @remarks On linux settings are stored in "~/.consig/product_name" file.
@@ -46,7 +46,7 @@ namespace xtd {
4646
/// @param key The key used to read a value.
4747
/// @param default_value A string used if value not found.
4848
/// @return A string that represent the value associate to the key.
49-
xtd::ustring read(const xtd::ustring& key, const xtd::ustring& default_value) {return read_string(key, default_value);}
49+
xtd::ustring read(const xtd::ustring& key, const xtd::ustring& default_value);
5050
/// @brief Reads a value for specified key. If not found default value is used.
5151
/// @tparam type_t The type of value to read.
5252
/// @param key The key used to read a value.
@@ -66,7 +66,7 @@ namespace xtd {
6666
/// @brief Writes a specified value for specified key.
6767
/// @param key The key used to write a value.
6868
/// @param value A string to write.
69-
void write(const xtd::ustring& key, const xtd::ustring& value) {write_string(key, value);}
69+
void write(const xtd::ustring& key, const xtd::ustring& value);
7070

7171
/// @brief Writes a specified value for specified key.
7272
/// @tparam type_t The type of value to write.

src/xtd.forms/src/xtd/settings.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ settings::~settings() {
4343
forms::native::settings::destroy(data_->settings_);
4444
}
4545

46-
xtd::ustring settings::read_string(const xtd::ustring& key, const xtd::ustring& default_value) {
47-
return forms::native::settings::read(data_->settings_, key, default_value);
46+
xtd::ustring settings::read(const xtd::ustring& key, const xtd::ustring& default_value) {
47+
return read_string(key, default_value);
4848
}
4949

5050
void settings::reset() {
@@ -55,6 +55,14 @@ void settings::save() {
5555
forms::native::settings::save(data_->settings_);
5656
}
5757

58+
void settings::write(const xtd::ustring& key, const xtd::ustring& value) {
59+
write_string(key, value);
60+
}
61+
62+
xtd::ustring settings::read_string(const xtd::ustring& key, const xtd::ustring& default_value) {
63+
return forms::native::settings::read(data_->settings_, key, default_value);
64+
}
65+
5866
void settings::write_string(const xtd::ustring& key, const xtd::ustring& value) {
5967
forms::native::settings::write(data_->settings_, key, value);
6068
}

0 commit comments

Comments
 (0)