HikoGUI
Select Version: ⚠️ This documents the main development branch of HikoGUI. It might differ from release versions.
A low latency retained GUI
|
#include <hikogui/path/glob.hpp>
Public Member Functions | |
constexpr | glob_pattern (glob_pattern const &) noexcept=default |
constexpr | glob_pattern (glob_pattern &&) noexcept=default |
constexpr glob_pattern & | operator= (glob_pattern const &) noexcept=default |
constexpr glob_pattern & | operator= (glob_pattern &&) noexcept=default |
constexpr | glob_pattern (std::u32string_view str) |
Parse a string to a glob-pattern. | |
constexpr | glob_pattern (std::u32string const &str) |
Parse a string to a glob-pattern. | |
constexpr | glob_pattern (char32_t const *str) |
Parse a string to a glob-pattern. | |
constexpr | glob_pattern (std::string_view str) |
Parse a string to a glob-pattern. | |
constexpr | glob_pattern (std::string const &str) |
Parse a string to a glob-pattern. | |
constexpr | glob_pattern (char const *str) |
Parse a string to a glob-pattern. | |
glob_pattern (std::filesystem::path const &path) | |
Parse a path to a glob-pattern. | |
constexpr std::u32string | u32string () noexcept |
Convert a glob-pattern to a string. | |
constexpr std::string | string () noexcept |
Convert a glob-pattern to a string. | |
constexpr std::u32string | debug_u32string () noexcept |
Convert a glob-pattern to a debug-string. | |
constexpr std::string | debug_string () noexcept |
Convert a glob-pattern to a debug-string. | |
constexpr std::u32string | base_u32string () const noexcept |
Get the initial fixed part of the pattern. | |
constexpr std::string | base_string () const noexcept |
Get the initial fixed part of the pattern. | |
std::filesystem::path | base_path () const noexcept |
Get the initial path of the pattern. | |
constexpr bool | matches (std::u32string_view str) const noexcept |
Match the pattern with the given string. | |
constexpr bool | matches (std::u32string const &str) const noexcept |
Match the pattern with the given string. | |
constexpr bool | matches (char32_t const *str) const noexcept |
Match the pattern with the given string. | |
constexpr bool | matches (std::string_view str) const noexcept |
Match the pattern with the given string. | |
constexpr bool | matches (std::string const &str) const noexcept |
Match the pattern with the given string. | |
constexpr bool | matches (char const *str) const noexcept |
Match the pattern with the given string. | |
bool | matches (std::filesystem::path const &path) const noexcept |
Match the pattern with the given path. | |
A glob pattern.
A glob algorithm is used for matching with filenames and directories. Glob may also be used on strings that do not involve the filesystem at all, however certain tokens implicitly include or exclude the slash '/' character.
Token | Description |
---|---|
foo | Matches the text "foo". |
? | Matches any single code-unit except '/'. |
[abcd] | Matches a single code-unit that is 'a', 'b', 'c' or 'd'. |
[a-d] | Matches a single code-unit that is 'a', 'b', 'c' or 'd'. |
[-a-d] | Matches a single code-unit that is '-', 'a', 'b', 'c' or 'd'. |
{foo,bar,baz} | Matches the text "foo", "bar" or "baz". |
* | Matches zero or more code-units except '/'. |
/ ** / | Matches A single slash '/' or zero or more code-units between two slashes '/'. |
|
inlineconstexpr |
Parse a string to a glob-pattern.
str | The string to be parsed. |
|
inlineconstexpr |
Parse a string to a glob-pattern.
str | The string to be parsed. |
|
inlineconstexpr |
Parse a string to a glob-pattern.
str | The string to be parsed. |
|
inlineconstexpr |
Parse a string to a glob-pattern.
str | The string to be parsed. |
|
inlineconstexpr |
Parse a string to a glob-pattern.
str | The string to be parsed. |
|
inlineconstexpr |
Parse a string to a glob-pattern.
str | The string to be parsed. |
|
inline |
Parse a path to a glob-pattern.
path | The path to be parsed. |
|
inlinenoexcept |
Get the initial path of the pattern.
This gets the initial path of the pattern that is fixed, this is used for as a starting point for a search.
For example this will be the directory where to start recursively iterating on.
|
inlineconstexprnoexcept |
Get the initial fixed part of the pattern.
This gets the initial part of the pattern that is fixed, this is used for as a starting point for a search.
For example by getting the base_string you can use a binary-search into a sorted list of strings, then once you find a string you can iterate over the list and glob-match each string.
|
inlineconstexprnoexcept |
Get the initial fixed part of the pattern.
This gets the initial part of the pattern that is fixed, this is used for as a starting point for a search.
For example by getting the base_string you can use a binary-search into a sorted list of strings, then once you find a string you can iterate over the list and glob-match each string.
|
inlineconstexprnoexcept |
Convert a glob-pattern to a debug-string.
This function is used for debugging the glob parser, and for using in unit-tests.
|
inlineconstexprnoexcept |
Convert a glob-pattern to a debug-string.
This function is used for debugging the glob parser, and for using in unit-tests.
|
inlineconstexprnoexcept |
Match the pattern with the given string.
str | The string to match with this pattern. |
|
inlineconstexprnoexcept |
Match the pattern with the given string.
str | The string to match with this pattern. |
|
inlinenoexcept |
Match the pattern with the given path.
path | The path to match with this pattern. |
|
inlineconstexprnoexcept |
Match the pattern with the given string.
str | The string to match with this pattern. |
|
inlineconstexprnoexcept |
Match the pattern with the given string.
str | The string to match with this pattern. |
|
inlineconstexprnoexcept |
Match the pattern with the given string.
str | The string to match with this pattern. |
|
inlineconstexprnoexcept |
Match the pattern with the given string.
str | The string to match with this pattern. |
|
inlineconstexprnoexcept |
Convert a glob-pattern to a string.
|
inlineconstexprnoexcept |
Convert a glob-pattern to a string.