1
1
#include " ../../../include/xtd/environment.h"
2
2
#include " ../../../include/xtd/configuration/file_settings.h"
3
3
#include " ../../../include/xtd/configuration/settings.h"
4
- #include " ../../../include/xtd/io/directory.h"
5
- #include " ../../../include/xtd/io/file.h"
6
4
#include " ../../../include/xtd/io/path.h"
7
- #include " ../../../include/xtd/io/stream_reader.h"
8
- #include " ../../../include/xtd/io/stream_writer.h"
9
5
#include " ../../../include/xtd/reflection/assembly.h"
10
6
#define __XTD_CORE_NATIVE_LIBRARY__
11
7
#include < xtd/native/settings>
12
8
#undef __XTD_CORE_NATIVE_LIBRARY__
13
- #include < map>
14
9
15
10
using namespace xtd ;
16
11
using namespace xtd ::configuration;
@@ -24,7 +19,7 @@ struct settings::data {
24
19
settings::settings () : data_(std::make_shared<data>()) {
25
20
auto product_name = [] {
26
21
if (assembly::get_executing_assembly ().product () != ustring::empty_string) return assembly::get_executing_assembly ().product ();
27
- if (environment::get_command_line_args ().size () != 0 ) return xtd::io:: path::get_file_name_without_extension (environment::get_command_line_args ()[0 ]);
22
+ if (environment::get_command_line_args ().size () != 0 ) return path::get_file_name_without_extension (environment::get_command_line_args ()[0 ]);
28
23
return " noname" _s;
29
24
};
30
25
@@ -36,11 +31,11 @@ settings::settings() : data_(std::make_shared<data>()) {
36
31
data_->file_settings = file_settings {native::settings::get_path (company_name (), product_name ())};
37
32
}
38
33
39
- const xtd:: ustring& settings::file_path () const noexcept {
34
+ const ustring& settings::file_path () const noexcept {
40
35
return data_->file_settings .file_path ();
41
36
}
42
37
43
- xtd:: ustring settings::read (const xtd:: ustring& key, const xtd:: ustring& default_value) {
38
+ ustring settings::read (const ustring& key, const ustring& default_value) {
44
39
return read_string (key, default_value);
45
40
}
46
41
@@ -52,14 +47,14 @@ void settings::save() {
52
47
data_->file_settings .save ();
53
48
}
54
49
55
- void settings::write (const xtd:: ustring& key, const xtd:: ustring& value) {
50
+ void settings::write (const ustring& key, const ustring& value) {
56
51
write_string (key, value);
57
52
}
58
53
59
- xtd:: ustring settings::read_string (const xtd:: ustring& key, const xtd:: ustring& default_value) {
54
+ ustring settings::read_string (const ustring& key, const ustring& default_value) {
60
55
return data_->file_settings .read (key, default_value);
61
56
}
62
57
63
- void settings::write_string (const xtd:: ustring& key, const xtd:: ustring& value) {
58
+ void settings::write_string (const ustring& key, const ustring& value) {
64
59
data_->file_settings .write (key, value);
65
60
}
0 commit comments