WRApplication
External kratos "application" for multiscale time integration.
|
A class for interfacing placeholders and regular expressions. More...
Public Member Functions | |
Life Cycle | |
PlaceholderPattern ()=default | |
PlaceholderPattern (Ref< const std::string > rPattern, Ref< const PlaceholderMap > rPlaceholderMap) | |
Construct from a placeholder pattern and its associated map. More... | |
PlaceholderPattern (PlaceholderPattern &&rOther)=default | |
PlaceholderPattern (const PlaceholderPattern &rOther)=default | |
virtual | ~PlaceholderPattern ()=default |
Operators | |
PlaceholderPattern & | operator= (PlaceholderPattern &&rOther)=default |
PlaceholderPattern & | operator= (const PlaceholderPattern &rOther)=default |
Operations | |
bool | IsAMatch (Ref< const std::string > rString) const |
Check whether a string satisfies the pattern. More... | |
MatchType | Match (Ref< const std::string > rString) const |
Find all placeholders' values in the input string. More... | |
std::string | Apply (Ref< const PlaceholderMap > rPlaceholderValueMap) const |
Substitute values in the stored pattern. More... | |
template<class TOutputIterator > | |
void | Glob (TOutputIterator it) const |
Collect all file/directory paths that match the pattern. More... | |
Inquiry | |
bool | IsConst () const |
Return true if the input pattern contains no placeholders. More... | |
Ref< const std::regex > | GetRegex () const |
Get the regex for the input pattern. More... | |
Ref< const std::string > | GetRegexString () const |
Get the string representation of the regex. More... | |
PlaceholderMap | GetPlaceholderMap () const |
Get a map of all placeholders and their associated regex representations. More... | |
Ref< const std::string > | GetPatternString () const |
Get the pattern with placeholders. More... | |
Type Definitions | |
using | PlaceholderMap = std::map< std::string, std::string > |
using | PlaceholderGroupMap = std::map< std::string, std::optional< std::vector< std::size_t > >> |
using | MatchType = std::map< std::string, std::vector< std::string > > |
using | PathType = std::filesystem::path |
KRATOS_CLASS_POINTER_DEFINITION (PlaceholderPattern) | |
A class for interfacing placeholders and regular expressions.
using MatchType = std::map<std::string,std::vector<std::string> > |
using PathType = std::filesystem::path |
using PlaceholderGroupMap = std::map<std::string,std::optional<std::vector<std::size_t> >> |
using PlaceholderMap = std::map<std::string,std::string> |
|
default |
PlaceholderPattern | ( | Ref< const std::string > | rPattern, |
Ref< const PlaceholderMap > | rPlaceholderMap | ||
) |
Construct from a placeholder pattern and its associated map.
rPattern | Pattern string with placeholders. |
rPlaceholderMap | Pairs of placeholders and their corresponding regex strings. Example: {{"<name>", ".+"}, {"<identifier>", "[0-9]+"}}
|
|
default |
|
default |
|
virtualdefault |
std::string Apply | ( | Ref< const PlaceholderMap > | rPlaceholderValueMap | ) | const |
Substitute values in the stored pattern.
Return a copy of the pattern that has its placeholders replaced with the corresponding values specified in the input map.
rPlaceholderValueMap | string - string map associating values to placeholders {"palceholder" : "placeholder_value"}
|
Ref<const std::string> GetPatternString | ( | ) | const |
Get the pattern with placeholders.
PlaceholderMap GetPlaceholderMap | ( | ) | const |
Get a map of all placeholders and their associated regex representations.
Ref<const std::regex> GetRegex | ( | ) | const |
Get the regex for the input pattern.
Ref<const std::string> GetRegexString | ( | ) | const |
Get the string representation of the regex.
void Glob | ( | TOutputIterator | it | ) | const |
Collect all file/directory paths that match the pattern.
TOutputIterator | output iterator with value type constructible from PathType. |
cwd
. bool IsAMatch | ( | Ref< const std::string > | rString | ) | const |
Check whether a string satisfies the pattern.
bool IsConst | ( | ) | const |
Return true if the input pattern contains no placeholders.
KRATOS_CLASS_POINTER_DEFINITION | ( | PlaceholderPattern | ) |
Find all placeholders' values in the input string.
rString | String matching the input pattern. |
|
default |
|
default |