|
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 '/'. |
constexpr std::string hi::v1::glob_pattern::base_string |
( |
| ) |
const |
|
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.
- Returns
- The initial fixed part of the pattern.
constexpr std::u32string hi::v1::glob_pattern::base_u32string |
( |
| ) |
const |
|
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.
- Returns
- The initial fixed part of the pattern.