aboutsummaryrefslogtreecommitdiff
path: root/lib/settings/configuration.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-12-08 14:22:19 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-12-08 14:22:19 +0100
commit4e3c479a0f279926e0bd9a359a0ee57b334e976e (patch)
tree068f1da93a4ff6dcce251f5152df16bf77be53a8 /lib/settings/configuration.h
parentlibconfig test (diff)
downloadsmolbote-4e3c479a0f279926e0bd9a359a0ee57b334e976e.tar.xz
Replaced tinytoml with libconfig
Diffstat (limited to 'lib/settings/configuration.h')
-rw-r--r--lib/settings/configuration.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/settings/configuration.h b/lib/settings/configuration.h
index e0f1872..548b816 100644
--- a/lib/settings/configuration.h
+++ b/lib/settings/configuration.h
@@ -18,8 +18,8 @@
**
******************************************************************************/
-#ifndef SETTINGS_H
-#define SETTINGS_H
+#ifndef CONFIGURATION_H
+#define CONFIGURATION_H
#include <optional>
#include <vector>
@@ -36,6 +36,8 @@ public:
~Configuration();
bool readUserConfiguration(const std::string &path);
+ bool writeUserConfiguration(const std::string &path);
+
bool readDefaultConfiguration(const std::string &data);
std::vector<std::string> children(const char *name = "");
@@ -54,6 +56,9 @@ private:
libconfig::Config *m_defaultCfg;
};
+// replace ~ with home
+std::string& patchHome(std::string &path, const std::string &home);
+
// instantiate functions
// this needs to be done because the implementation is in the cpp file
@@ -89,4 +94,4 @@ extern template void Configuration::setValue<bool>(std::string path, const bool
extern template void Configuration::setValue<std::string>(std::string path, const std::string &val);
-#endif // SETTINGS_H
+#endif // CONFIGURATION_H