7#include "../utility/utility.hpp"
8#include "../metadata/metadata.hpp"
9#include "../macros.hpp"
20hi_export_module(hikogui.path.path_location : intf);
22hi_export
namespace hi {
inline namespace v1 {
25template<
typename Context>
27 std::ranges::input_range<Context>
and
28 std::convertible_to<std::ranges::range_value_t<std::remove_cvref_t<Context>>, std::filesystem::path>
and
29 not std::convertible_to<Context, std::filesystem::path>;
38template<path_range Locations>
39[[
nodiscard]] hi_inline std::optional<std::filesystem::path>
42 if (ref.is_absolute()) {
43 if (std::filesystem::exists(ref)) {
50 auto path = base / ref;
51 if (std::filesystem::exists(path)) {
70 tmp.remove_filename();
117 if (
not std::filesystem::exists(path)) {
179 auto path = std::filesystem::path{
__FILE__};
180 path.replace_filename(
"../../..");
std::filesystem::path executable_file() noexcept
Get the full path to this executable.
std::filesystem::path log_dir() noexcept
Get the full path to the directory where the application should store its log files.
std::filesystem::path data_dir() noexcept
Get the full path to the directory where the application should store its data.
std::filesystem::path preferences_file() noexcept
Get the full path to application preferences file.
hi_inline std::filesystem::path executable_dir() noexcept
Get the full path to the directory when this executable is located.
Definition path_location_intf.hpp:67
hi_inline generator< std::filesystem::path > resource_dirs() noexcept
The directories to search for resource files.
hi_inline std::optional< std::filesystem::path > source_dir() noexcept
Get the full path to source code of this executable.
Definition path_location_intf.hpp:150
hi_inline generator< std::filesystem::path > font_files() noexcept
The directories to search for font files of both the application and system.
hi_inline std::optional< std::filesystem::path > library_install_dir() noexcept
The full path where HikoGUI is installed during compilation of the application.
Definition path_location_intf.hpp:171
hi_inline generator< std::filesystem::path > theme_files() noexcept
The directories to search for theme files of the application.
hi_inline generator< std::filesystem::path > system_font_dirs() noexcept
The directories to search for system font files.
hi_inline std::optional< std::filesystem::path > find_path(Locations &&locations, std::filesystem::path const &ref) noexcept
Find a path.
Definition path_location_intf.hpp:40
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
hi_inline std::optional< std::filesystem::path > source_dir_parse_cmake_install(std::filesystem::path path) noexcept
Parse the source dir from a cmake_install.cmake file.
Definition path_location_intf.hpp:115
hi_inline std::basic_string< CharT, Traits > getline(std::basic_istream< CharT, Traits > &in, size_t max_size) noexcept
Get a line from an input string, upto a maximum size.
Definition misc.hpp:112
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
Definition path_location_intf.hpp:26