aboutsummaryrefslogtreecommitdiff
path: root/include/wanda/xdg.hpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2018-12-11 07:42:05 +0100
committerFelix Morgner <felix.morgner@gmail.com>2018-12-11 07:42:05 +0100
commited419140280553b070943b7ba539120a26ff5686 (patch)
tree3d134977a6dfae71a45c318305166d044b50320d /include/wanda/xdg.hpp
parentd3e691c9200b7b782c8acf17468068a699588a73 (diff)
downloadwanda-ed419140280553b070943b7ba539120a26ff5686.tar.xz
wanda-ed419140280553b070943b7ba539120a26ff5686.zip
wanda: restructure directory hierarchy
Diffstat (limited to 'include/wanda/xdg.hpp')
-rw-r--r--include/wanda/xdg.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/wanda/xdg.hpp b/include/wanda/xdg.hpp
new file mode 100644
index 0000000..bc138fa
--- /dev/null
+++ b/include/wanda/xdg.hpp
@@ -0,0 +1,40 @@
+/**
+ * @file xdg.hpp
+ * @author Felix Morgner (felix.morgner@gmail.com)
+ * @since 1.0.0
+ */
+
+#ifndef WANDA_XDG_HPP
+#define WANDA_XDG_HPP
+
+#include <wanda/environment.hpp>
+
+#include <cstddef>
+#include <filesystem>
+#include <type_traits>
+
+namespace wanda
+{
+ /**
+ * @brief An @p enum to represet the standardized XDG directories
+ */
+ enum struct xdg_directory : std::underlying_type_t<std::byte>
+ {
+ data_home,
+ config_home,
+ cache_home,
+ runtime_dir,
+ };
+
+ /**
+ * @brief Get the name of the environment variable associated with the given XDG directory
+ */
+ std::string xdg_variable(xdg_directory directory);
+
+ /**
+ * @brief Get the path to the given @p directory given the provided @p environment
+ */
+ std::filesystem::path xdg_path_for(xdg_directory directory, environment const & environment);
+} // namespace wanda
+
+#endif \ No newline at end of file