diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2024-05-17 17:58:38 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2024-05-17 17:58:38 +0200 |
| commit | 577fc0845718ed8ad5bebf02a277c0579a817f77 (patch) | |
| tree | 3d1cdc53c426a0ba60a7996619a7b787850bb3b3 /source/lib/include/wanda/system/xdg.hpp | |
| parent | de5bf7ca3b7a2bf6be35b86486b00dc6a071b950 (diff) | |
| download | wanda-577fc0845718ed8ad5bebf02a277c0579a817f77.tar.xz wanda-577fc0845718ed8ad5bebf02a277c0579a817f77.zip | |
Diffstat (limited to 'source/lib/include/wanda/system/xdg.hpp')
| -rw-r--r-- | source/lib/include/wanda/system/xdg.hpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/source/lib/include/wanda/system/xdg.hpp b/source/lib/include/wanda/system/xdg.hpp new file mode 100644 index 0000000..ae01feb --- /dev/null +++ b/source/lib/include/wanda/system/xdg.hpp @@ -0,0 +1,40 @@ +/** + * @file xdg.hpp + * @author Felix Morgner (felix.morgner@gmail.com) + * @since 1.0.0 + */ + +#ifndef WANDA_SYSTEM_XDG_HPP +#define WANDA_SYSTEM_XDG_HPP + +#include "wanda/system/environment.hpp" + +#include <cstddef> +#include <filesystem> +#include <type_traits> + +namespace wanda::system +{ + /** + * @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::system + +#endif
\ No newline at end of file |
