aboutsummaryrefslogtreecommitdiff
path: root/include/dchat/Storage.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/dchat/Storage.hpp')
-rw-r--r--include/dchat/Storage.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/dchat/Storage.hpp b/include/dchat/Storage.hpp
new file mode 100644
index 0000000..4f3dfa2
--- /dev/null
+++ b/include/dchat/Storage.hpp
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <functional>
+#include <string>
+#include <unordered_map>
+#include <boost/filesystem/path.hpp>
+
+namespace dchat
+{
+ // Throws runtime exception on failure
+ boost::filesystem::path getHomeDir();
+
+ // Creates directory if it doesn't exist (recursively). Throws boost exception on failure
+ boost::filesystem::path getDchatDir();
+
+ // Creates directory if it doesn't exist (recursively). Throws boost exception on failure
+ boost::filesystem::path getImagesDir();
+
+ using LoadBindsCallbackFunc = std::function<void(const std::string &key, const std::string &value)>;
+
+ // @callbackFunc can't be nullptr
+ void loadBindsFromFile(LoadBindsCallbackFunc callbackFunc);
+ void replaceBindsInFile(const std::unordered_map<std::string, std::string> &binds);
+} \ No newline at end of file