diff options
Diffstat (limited to 'src/util/fs.hpp')
-rw-r--r-- | src/util/fs.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/util/fs.hpp b/src/util/fs.hpp new file mode 100644 index 0000000..860c055 --- /dev/null +++ b/src/util/fs.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include <filesystem> +#include <string_view> +#include <unordered_map> + +const std::unordered_map<std::filesystem::file_type, std::string_view> file_type_names = { + {std::filesystem::file_type::none, "none"}, + {std::filesystem::file_type::not_found, "not_found"}, + {std::filesystem::file_type::regular, "regular"}, + {std::filesystem::file_type::directory, "directory"}, + {std::filesystem::file_type::symlink, "symlink"}, + {std::filesystem::file_type::block, "block"}, + {std::filesystem::file_type::character, "character"}, + {std::filesystem::file_type::fifo, "fifo"}, + {std::filesystem::file_type::socket, "socket"}, + {std::filesystem::file_type::unknown, "unknown"}}; + +auto get_current_user_home_path() noexcept -> std::filesystem::path; + +auto expand_path_home(const std::filesystem::path &path) noexcept + -> std::filesystem::path; |