From f4d9880d3c9555b48affad727589ef5c093b1841 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 16 Sep 2022 23:28:09 +0200 Subject: source: clean up structure --- source/lib/include/wanda/xdg.hpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 source/lib/include/wanda/xdg.hpp (limited to 'source/lib/include/wanda/xdg.hpp') diff --git a/source/lib/include/wanda/xdg.hpp b/source/lib/include/wanda/xdg.hpp new file mode 100644 index 0000000..833e4a0 --- /dev/null +++ b/source/lib/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 +#include +#include + +namespace wanda +{ + /** + * @brief An @p enum to represet the standardized XDG directories + */ + enum struct xdg_directory : std::underlying_type_t + { + 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 -- cgit v1.2.3