![]() |
Home | Libraries | Author | Links |
An object of class filespeclist represents a list of filespec objects and flags to be used as default flags for construction of filespec objects to be inserted. As the implementation of filespeclist uses regular expressions (see Abstract Data Type StmRe), for its error control the macro StmRectrlTry can be used.
Definition at line 1179 of file filesysaids.hpp.
With filespec flags bitwise orable flags | |
static const dword | NoFlags = 0 |
static const dword | NoBraceExpansion = impl::NoBraceExpansion |
static const dword | SingleSpec = impl::SingleSpec |
Public Types | |
typedef impl::const_iterator | const_iterator |
Constant filespeclist iterator. | |
Public Member Functions | |
filespeclist (dword flags=filespec::NoFlags) | |
Construct an empty filespeclist object with flags as default flags. | |
filespeclist (const std::string &specs, dword flags=NoFlags) | |
Constructs a filespeclist object with flags as default flags containing filespec objects as if append (specs, flags) was executed. | |
void | clear () |
Empties this filespeclist. | |
void | append (const std::string &specs) |
Appends filespec objects to this filespelist as if the method append (specs, flags) with the object's default flags was executed. | |
void | append (const std::string &specs, dword flags) |
Appends filespec objects defined by specs and flags to this filespeclist. | |
bool | matches (const std::string &entry) const |
The method matches returns true, if entry matches one of the file system element names defined by any filespec object in this filespeclist, else false. | |
word | matches (const std::string &entry, word mask) const |
The method matches looks for the first filespec in this filspeclist matching entry, such that the matching filespec's status logical anded with mask is not null. |
typedef impl::const_iterator stm::filespeclist::const_iterator |
Constant filespeclist iterator.
Reimplemented in stm::tools::CtExceptions.
Definition at line 1183 of file filesysaids.hpp.
stm::filespeclist::filespeclist | ( | dword | flags = filespec::NoFlags |
) |
Construct an empty filespeclist object with flags as default flags.
For flags the values NoBraceExpansion and SingleSpec as well as the flags of class filespec may be used. As all these flag values use only the most significant word of the flags dword, the least significant word of the flags dword may be used for user supplied status. This status is evaluated in the method matches (entry, state).
stm::filespeclist::filespeclist | ( | const std::string & | specs, | |
dword | flags = NoFlags | |||
) |
Constructs a filespeclist object with flags as default flags containing filespec objects as if append (specs, flags) was executed.
Throws on error.
void stm::filespeclist::clear | ( | ) |
void stm::filespeclist::append | ( | const std::string & | specs | ) |
Appends filespec objects to this filespelist as if the method append (specs, flags) with the object's default flags was executed.
Throws on error.
void stm::filespeclist::append | ( | const std::string & | specs, | |
dword | flags | |||
) |
Appends filespec objects defined by specs and flags to this filespeclist.
If the flag SingleSpec is set, if specs contains one of the unescaped extended regular expression operators '(' or '|', if the flag filespec::UseExtRegularExpr is set, if specs contains no unescaped '{', or if the flag NoBraceExpansion is set, the filespec object filespec (specs, flags) is appended to this filespeclist.
Otherwise specs is brace expanded as in the bash shell and for each word resulting thus the filespec object filespec (word, flags) is appended to this filespeclist. On Windows systems as escape character for brace expansion '%' is used instead of the usual '\'. Throws on error.
bool stm::filespeclist::matches | ( | const std::string & | entry | ) | const |
The method matches returns true, if entry matches one of the file system element names defined by any filespec object in this filespeclist, else false.
word stm::filespeclist::matches | ( | const std::string & | entry, | |
word | mask | |||
) | const |
The method matches looks for the first filespec in this filspeclist matching entry, such that the matching filespec's status logical anded with mask is not null.
This non-null value is returned, if such a match was found, else 0.
© Copyright Tom Michaelis 2002-2007
Distributed under the SysToMath Software License (See the accompanying file license.txt or a copy at www.SysToMath.com).