diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-08-24 18:15:11 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-08-24 18:15:11 +0000 |
commit | da642482dee91921fc16786208aa497d3ee31d94 (patch) | |
tree | bae598fca2bb2b55661bc1c854b43a1393aced23 /src/unstable/settings.cpp | |
parent | f5ac2c1ba333ce6aa6d385d9a63b658caaa46503 (diff) | |
download | libbu++-da642482dee91921fc16786208aa497d3ee31d94.tar.gz libbu++-da642482dee91921fc16786208aa497d3ee31d94.tar.bz2 libbu++-da642482dee91921fc16786208aa497d3ee31d94.tar.xz libbu++-da642482dee91921fc16786208aa497d3ee31d94.zip |
Adding new Bu::Settings system, which works more or less like QSettings from Qt,
only...without qt.
It's the first real system in libbu++ that is going to be all unicode, which
is exciting, but I'm having to actually finish the Bu::UtfString class while I
work on it. Also exciting.
Diffstat (limited to '')
-rw-r--r-- | src/unstable/settings.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/unstable/settings.cpp b/src/unstable/settings.cpp new file mode 100644 index 0000000..e993250 --- /dev/null +++ b/src/unstable/settings.cpp | |||
@@ -0,0 +1,40 @@ | |||
1 | #include "bu/settings.h" | ||
2 | |||
3 | #include "bu/settingsdrivertaf.h" | ||
4 | |||
5 | Bu::Settings::Settings( const Bu::UtfString &sCompany, | ||
6 | const Bu::UtfString &sProduct, Bu::Settings::Driver eDriver ) : | ||
7 | sCompany( sCompany ), | ||
8 | sProduct( sProduct ), | ||
9 | pDriver( NULL ) | ||
10 | { | ||
11 | switch( eDriver ) | ||
12 | { | ||
13 | case DriverNative: | ||
14 | #if defined( WIN32 ) | ||
15 | #else | ||
16 | pDriver = new Bu::SettingsDriverTaf(); | ||
17 | #endif | ||
18 | break; | ||
19 | |||
20 | case DriverTaf: | ||
21 | pDriver = new Bu::SettingsDriverTaf(); | ||
22 | break; | ||
23 | |||
24 | case DriverIni: | ||
25 | throw Bu::ExceptionBase("Not supported"); | ||
26 | break; | ||
27 | } | ||
28 | |||
29 | pDriver->init( sCompany, sProduct ); | ||
30 | } | ||
31 | |||
32 | Bu::Settings::~Settings() | ||
33 | { | ||
34 | delete pDriver; | ||
35 | } | ||
36 | |||
37 | void Bu::Settings::set( const Bu::UtfString &sKey, const Bu::UtfString &sValue ) | ||
38 | { | ||
39 | } | ||
40 | |||