9#include "path_location_intf.hpp"
10#include "../metadata/metadata.hpp"
11#include "../telemetry/telemetry.hpp"
12#include "../utility/utility.hpp"
13#include "../char_maps/char_maps.hpp"
14#include "../win32/win32.hpp"
15#include "../macros.hpp"
20hi_export_module(hikogui.path.path_location : impl);
22hi_export
namespace hi {
25[[nodiscard]]
inline std::expected<std::filesystem::path, std::error_code>
executable_file() noexcept
27 static auto r = []() -> std::expected<std::filesystem::path, std::error_code> {
28 if (
auto path = win32_GetModuleFileName()) {
38[[nodiscard]]
inline std::expected<std::filesystem::path, std::error_code>
data_dir() noexcept
40 static auto r = []() -> std::expected<std::filesystem::path, std::error_code> {
44 return *path / get_application_vendor() / get_application_name() /
"";
53[[nodiscard]]
inline std::expected<std::filesystem::path, std::error_code>
log_dir() noexcept
57 return *path /
"Log" /
"";
63[[nodiscard]]
inline generator<std::filesystem::path>
resource_dirs() noexcept
67 co_yield *path /
"resources" /
"";
72 co_yield *path /
"resources" /
"";
78 co_yield *source_dir_ /
"resources" /
"";
81 if (
auto path = library_cmake_build_dir(); not path.empty()) {
82 co_yield path /
"resources" /
"";
86 if (
auto path = library_cmake_source_dir(); not path.empty()) {
87 co_yield path /
"resources" /
"";
91 co_yield library_source_dir() /
"resources" /
"";
94 co_yield library_source_dir() /
"share" /
"hikogui" /
"resources" /
"";
105[[nodiscard]]
inline generator<std::filesystem::path> font_dirs() noexcept
115[[nodiscard]]
inline generator<std::filesystem::path> theme_dirs() noexcept
Rules for working with win32 headers.
std::expected< std::filesystem::path, std::error_code > log_dir() noexcept
Get the full path to the directory where the application should store its log files.
Definition path_location_win32_impl.hpp:53
generator< std::filesystem::path > resource_dirs() noexcept
The directories to search for resource files.
Definition path_location_win32_impl.hpp:63
std::expected< std::filesystem::path, std::error_code > executable_dir() noexcept
Get the full path to the directory when this executable is located.
Definition path_location_intf.hpp:174
std::expected< std::filesystem::path, std::error_code > executable_file() noexcept
Get the full path to this executable.
Definition path_location_win32_impl.hpp:25
generator< std::filesystem::path > system_font_dirs() noexcept
The directories to search for system font files.
Definition path_location_win32_impl.hpp:98
std::optional< std::filesystem::path > source_dir() noexcept
Get the full path to source code of this executable.
Definition path_location_intf.hpp:219
std::expected< std::filesystem::path, std::error_code > data_dir() noexcept
Get the full path to the directory where the application should store its data.
Definition path_location_win32_impl.hpp:38
The HikoGUI namespace.
Definition array_generic.hpp:20
std::expected< std::filesystem::path, hresult_error > win32_SHGetKnownFolderPath(KNOWNFOLDERID const &folder_id) noexcept
Convenience function for SHGetKnownFolderPath().
Definition shlobj_core.hpp:26
DOXYGEN BUG.
Definition algorithm_misc.hpp:20