Panda3D
|
This class can be used to test for string matches against standard Unix-shell filename globbing conventions. More...
Public Member Functions | |
GlobPattern (GlobPattern const copy) | |
GlobPattern (string pattern) | |
GlobPattern () | |
bool | getCaseSensitive () |
Returns whether the match is case sensitive (true) or case insensitive (false). | |
string | getConstPrefix () |
string | getNomatchChars () |
Returns the set of characters that are not matched by or ?. | |
string | getPattern () |
Returns the pattern string that the GlobPattern object matches. | |
bool | hasGlobCharacters () |
bool | matches (string candidate) |
Returns true if the candidate string matches the pattern, false otherwise. | |
int | matchFiles (vectorbasic_stringchar results, Filename const cwd) |
int | matchFiles (vectorbasic_stringchar results) |
bool | operator!= (GlobPattern const other) |
bool | operator< (GlobPattern const other) |
GlobPattern | operator= (GlobPattern const copy) |
bool | operator== (GlobPattern const other) |
output (ostream out) | |
setCaseSensitive (bool case_sensitive) | |
Sets whether the match is case sensitive (true) or case insensitive (false). | |
setNomatchChars (string nomatch_chars) | |
Specifies a set of characters that are not matched by or ?. | |
setPattern (string pattern) | |
Changes the pattern string that the GlobPattern object matches. |
This class can be used to test for string matches against standard Unix-shell filename globbing conventions.
It serves as a portable standin for the Posix fnmatch() call.
A GlobPattern is given a pattern string, which can contain operators like *, ?, and []. Then it can be tested against any number of candidate strings; for each candidate, it will indicate whether the string matches the pattern or not. It can be used, for example, to scan a directory for all files matching a particular pattern.
GlobPattern | ( | GlobPattern const | copy | ) |
GlobPattern | ( | string | pattern | ) |
GlobPattern | ( | ) |
bool getCaseSensitive | ( | ) |
Returns whether the match is case sensitive (true) or case insensitive (false).
The default is case sensitive.
string getConstPrefix | ( | ) |
string getNomatchChars | ( | ) |
Returns the set of characters that are not matched by or ?.
string getPattern | ( | ) |
Returns the pattern string that the GlobPattern object matches.
bool hasGlobCharacters | ( | ) |
bool matches | ( | string | candidate | ) |
Returns true if the candidate string matches the pattern, false otherwise.
int matchFiles | ( | vectorbasic_stringchar | results | ) |
bool operator!= | ( | GlobPattern const | other | ) |
bool operator< | ( | GlobPattern const | other | ) |
GlobPattern operator= | ( | GlobPattern const | copy | ) |
bool operator== | ( | GlobPattern const | other | ) |
output | ( | ostream | out | ) |
setCaseSensitive | ( | bool | case_sensitive | ) |
Sets whether the match is case sensitive (true) or case insensitive (false).
The default is case sensitive.
setNomatchChars | ( | string | nomatch_chars | ) |
Specifies a set of characters that are not matched by or ?.
setPattern | ( | string | pattern | ) |
Changes the pattern string that the GlobPattern object matches.