11#include "../generator.hpp"
12#include "../utility/module.hpp"
16namespace hi {
inline namespace v1 {
83[[nodiscard]]
inline std::optional<std::filesystem::path>
find_path(
path_location location, std::filesystem::path
const &ref)
noexcept
85 if (ref.is_absolute()) {
86 if (std::filesystem::exists(ref)) {
93 auto path = base / ref;
94 if (std::filesystem::exists(path)) {
112 auto it = std::ranges::begin(range);
113 hilet last = std::ranges::end(range);
122 throw url_error(
"More than one path found.");
std::optional< std::filesystem::path > find_path(path_location location, std::filesystem::path const &ref) noexcept
Find a path.
Definition path_location.hpp:83
path_location
File and Directory locations.
Definition path_location.hpp:21
generator< std::filesystem::path > get_paths(path_location location)
Get a set of paths.
std::filesystem::path get_path(path_location location)
Get the single and only path.
Definition path_location.hpp:109
@ data_dir
The single directory where the data for the application is stored for the current user account.
Definition path_location.hpp:45
@ resource_dirs
The location of application resources.
Definition path_location.hpp:24
@ executable_file
A single file where the current running executable is located.
Definition path_location.hpp:28
@ theme_dirs
The directories where the themes are located.
Definition path_location.hpp:65
@ library_dir
The single directory where the HikoGUI shared library is located.
Definition path_location.hpp:41
@ preferences_file
A single file where to store or load the application preferences file for the current user account.
Definition path_location.hpp:53
@ executable_dir
The directory where the executable is located.
Definition path_location.hpp:32
@ library_file
A single file where the current running HikoGUI shared library is located.
Definition path_location.hpp:37
@ log_dir
The single directory where to store the log files.
Definition path_location.hpp:49
@ system_font_dirs
The directories where the system fonts are stored.
Definition path_location.hpp:57
@ font_dirs
The directories where the fonts for the system and resource fonts are located.
Definition path_location.hpp:61
geometry/margins.hpp
Definition cache.hpp:11
The HikoGUI API version 1.
Definition cache.hpp:11
Definition exception.hpp:201