|
HikoGUI
A low latency retained GUI
|
Files | |
| file | glob.hpp |
| Defines utilities for handling glob patterns. | |
| file | path_location.hpp |
| functions to locate files and directories. | |
Data Structures | |
| class | hi::v1::glob_pattern |
| A glob pattern. More... | |
Functions | |
| hi_export generator< std::filesystem::path > | hi::v1::glob (std::string_view pattern) noexcept |
| Find paths on the filesystem that match the glob pattern. | |
| hi_export generator< std::filesystem::path > | hi::v1::glob (std::string pattern) noexcept |
| Find paths on the filesystem that match the glob pattern. | |
| hi_export generator< std::filesystem::path > | hi::v1::glob (char const *pattern) noexcept |
| Find paths on the filesystem that match the glob pattern. | |
| hi_export generator< std::filesystem::path > | hi::v1::glob (std::filesystem::path pattern) noexcept |
| Find paths on the filesystem that match the glob pattern. | |
| template<path_range Locations> | |
| hi_export generator< std::filesystem::path > | hi::v1::glob (Locations &&locations, std::filesystem::path ref) noexcept |
| Find paths on the filesystem that match the glob pattern. | |
| template<path_range Locations> | |
| hi_export generator< std::filesystem::path > | hi::v1::glob (Locations &&locations, std::string_view ref) noexcept |
| Find paths on the filesystem that match the glob pattern. | |
| template<path_range Locations> | |
| hi_export generator< std::filesystem::path > | hi::v1::glob (Locations &&locations, std::string ref) noexcept |
| Find paths on the filesystem that match the glob pattern. | |
| template<path_range Locations> | |
| hi_export generator< std::filesystem::path > | hi::v1::glob (Locations &&locations, char const *ref) noexcept |
| Find paths on the filesystem that match the glob pattern. | |
| template<path_range Locations> | |
| generator< std::filesystem::path > | hi::v1::find_path (Locations &&locations, std::filesystem::path const &ref) noexcept |
| Find a path. | |
| generator< std::filesystem::path > | hi::v1::find_path (std::filesystem::path const &location, std::filesystem::path const &ref) noexcept |
| Find a path. | |
| template<path_range Locations> | |
| std::filesystem::path | hi::v1::get_path (Locations &&locations, std::filesystem::path const &ref) |
| Get a path. | |
| std::filesystem::path | hi::v1::get_path (std::filesystem::path const &location, std::filesystem::path const &ref) |
| Get a path. | |
| std::filesystem::path | hi::v1::get_path (std::expected< std::filesystem::path, std::error_code > const &location, std::filesystem::path const &ref) |
| Get a path. | |
| std::expected< std::filesystem::path, std::error_code > | hi::v1::executable_file () noexcept |
| Get the full path to this executable. | |
| std::expected< std::filesystem::path, std::error_code > | hi::v1::executable_dir () noexcept |
| Get the full path to the directory when this executable is located. | |
| std::expected< std::filesystem::path, std::error_code > | hi::v1::data_dir () noexcept |
| Get the full path to the directory where the application should store its data. | |
| std::expected< std::filesystem::path, std::error_code > | hi::v1::log_dir () noexcept |
| Get the full path to the directory where the application should store its log files. | |
| generator< std::filesystem::path > | hi::v1::resource_dirs () noexcept |
| The directories to search for resource files. | |
| generator< std::filesystem::path > | hi::v1::system_font_dirs () noexcept |
| The directories to search for system font files. | |
| generator< std::filesystem::path > | hi::v1::font_files () noexcept |
| The directories to search for font files of both the application and system. | |
| generator< std::filesystem::path > | hi::v1::theme_files () noexcept |
| The directories to search for theme files of the application. | |
| std::optional< std::filesystem::path > | hi::v1::source_dir () noexcept |
| Get the full path to source code of this executable. | |
This module contains file handling utilities:
*_dir(), *_dirs(), *_file() for getting the configured paths of the system.find_path() to find files in a set of directories.glob_pattern, glob() to find files and directories based on a glob pattern.URI and URL for managing URLs for local and remote resources.The path-locations functions are used to find files and directories based on the context of the operating system, the user account and application.
For example fonts are located in multiple places:
To iterate over all the font directories:
To find the first matching file in one of the font directories:
To find files based on a pattern using wild cards like * you can use the glob utilities.
The constructor of the glob_pattern object parses a string or std::filesystem::path which contain one or more of the following tokens:
| Token | Description |
|---|---|
| foo | Matches the text "foo". |
| ? | Matches any single character except '/'. |
| [abcd] | Matches a single character that is 'a', 'b', 'c' or 'd'. |
| [a-d] | Matches a single character that is 'a', 'b', 'c' or 'd'. |
| [-a-d] | Matches a single character that is '-', 'a', 'b', 'c' or 'd'. |
| {foo,bar,baz} | Matches the text "foo", "bar" or "baz". |
| * | Matches zero or more character except '/'. |
| /**/ | Matches one or more directories. A single slash or zero or more characters between two slashes. |
Then the glob() function will search for files and directories matching this pattern. glob() is also overloaded to directly parse a pattern and combine it with path_location.
For example to find all the files in the font directories:
The URI, URL and URN terms can be confusing, here is a short explanation.
HikoGUI currently implements dereferencing of the following types of URLs:
resource_dirs().Both file: and resource: URLs may be implicitly converted to a std::filesystem::path.
|
inlinenoexcept |
Get the full path to the directory where the application should store its data.
|
inlinenoexcept |
Get the full path to the directory when this executable is located.
|
inlinenoexcept |
Get the full path to this executable.
|
inlinenoexcept |
Find a path.
| locations | The locations to search for filesystem-object. |
| ref | A relative path to the filesystem-object. |
|
inlinenoexcept |
Find a path.
| location | The location to search for filesystem-object. |
| ref | A relative path to the filesystem-object. |
|
inlinenoexcept |
The directories to search for font files of both the application and system.
|
inline |
Get a path.
| locations | The locations to search for filesystem-object. |
| ref | A relative path to the filesystem-object. |
| io_error | When a path is not found. |
|
inline |
Get a path.
| location | The locations to search for filesystem-object. |
| ref | A relative path to the filesystem-object. |
| io_error | When a path is not found. |
|
inline |
Get a path.
| location | The locations to search for filesystem-object. |
| ref | A relative path to the filesystem-object. |
| io_error | When a path is not found. |
|
inlinenoexcept |
Find paths on the filesystem that match the glob pattern.
| pattern | The pattern to search the filesystem for. |
|
inlinenoexcept |
Find paths on the filesystem that match the glob pattern.
| locations | The path-locations to search files in |
| ref | A relative path pattern to search the path-location |
|
inlinenoexcept |
Find paths on the filesystem that match the glob pattern.
| locations | The path-locations to search files in |
| ref | A relative path pattern to search the path-location |
|
inlinenoexcept |
Find paths on the filesystem that match the glob pattern.
| locations | The path-locations to search files in |
| ref | A relative path pattern to search the path-location |
|
inlinenoexcept |
Find paths on the filesystem that match the glob pattern.
| locations | The path-locations to search files in |
| ref | A relative path pattern to search the path-location |
|
inlinenoexcept |
Find paths on the filesystem that match the glob pattern.
| pattern | The pattern to search the filesystem for. |
|
inlinenoexcept |
Find paths on the filesystem that match the glob pattern.
| pattern | The pattern to search the filesystem for. |
|
inlinenoexcept |
Find paths on the filesystem that match the glob pattern.
| pattern | The pattern to search the filesystem for. |
|
inlinenoexcept |
Get the full path to the directory where the application should store its log files.
|
inlinenoexcept |
The directories to search for resource files.
|
inlinenoexcept |
Get the full path to source code of this executable.
| std::nullopt | The executable is not located in its build directory. |
|
inlinenoexcept |
The directories to search for system font files.
|
inlinenoexcept |
The directories to search for theme files of the application.