libzypp 17.31.23
|
Find pathnames matching a pattern. More...
#include <Glob.h>
Classes | |
class | const_iterator |
Iterate NULL terminated char* array. More... | |
Public Types | |
enum | Bits { kErr = GLOB_ERR , kMark = GLOB_MARK , kNoSort = GLOB_NOSORT , kNoCheck = GLOB_NOCHECK , kNoEscape = GLOB_NOESCAPE , kPeriod = GLOB_PERIOD , kAltDirFunc = GLOB_ALTDIRFUNC , kBrace = GLOB_BRACE , kNoMagic = GLOB_NOMAGIC , kTilde = GLOB_TILDE , kOnlyDir = GLOB_ONLYDIR , kTildeCheck = GLOB_TILDE_CHECK } |
Individual bits to combine in Flags. More... | |
typedef size_t | size_type |
typedef const char * | value_type |
Public Member Functions | |
ZYPP_DECLARE_FLAGS (Flags, Bits) | |
type Flags: Type-safe OR-combination of Bits. | |
Glob (Flags flags_r=Flags()) | |
Default ctor optionally taking the default flags. | |
Glob (const Pathname &pattern_r, Flags flags_r=Flags()) | |
Ctor adding pathnames matching pattern_r. | |
Glob (const std::string &pattern_r, Flags flags_r=Flags()) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Glob (const char *pattern_r, Flags flags_r=Flags()) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
~Glob () | |
Dtor. | |
int | add (const Pathname &pattern_r, Flags flags_r=Flags()) |
Add pathnames matching pattern_r to the current result. | |
int | add (const std::string &pattern_r, Flags flags_r=Flags()) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
int | add (const char *pattern_r, Flags flags_r=Flags()) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | clear () |
Clear all results found so far. | |
void | reset (Flags flags_r=Flags()) |
Clear all results and reset defaultFlags. | |
Flags | defaultFlags () const |
The default flags passed to ::glob() . | |
void | setDefaultFlags (Flags flags_r=Flags()) |
Set the default flags passed to ::glob() . | |
int | lastGlobReturn () const |
Returns the value returned by the last call to ::glob() . | |
bool | empty () const |
Whether matches were found. | |
size_type | size () const |
The number of matches found so far. | |
const_iterator | begin () const |
Iterator pointing to the first result. | |
const_iterator | end () const |
Iterator pointing behind the last result. | |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &str, const Glob &obj) |
Stream output. | |
Collecting Glob results to some TOutputIterator | |
std::list<Pathname> p;
Glob::collect( "/bin/a*.dat}", std::back_inserter(p) );
static int collect(const Pathname &pattern_r, TOutputIterator result_r) Write glob result to some OutputIterator. Definition: Glob.h:216 | |
Flags | _defaultFlags |
scoped_ptr< ::glob_t > | _result |
DefaultIntegral< int, 0 > | _lastGlobReturn |
template<class TOutputIterator > | |
static int | collect (const Pathname &pattern_r, TOutputIterator result_r) |
Write glob result to some OutputIterator . | |
template<class TOutputIterator > | |
static int | collect (const std::string &pattern_r, TOutputIterator result_r) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<class TOutputIterator > | |
static int | collect (const char *pattern_r, TOutputIterator result_r) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<class TOutputIterator > | |
static int | collect (const Pathname &pattern_r, Flags flags_r, TOutputIterator result_r) |
template<class TOutputIterator > | |
static int | collect (const std::string &pattern_r, Flags flags_r, TOutputIterator result_r) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<class TOutputIterator > | |
static int | collect (const char *pattern_r, Flags flags_r, TOutputIterator result_r) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Find pathnames matching a pattern.
typedef size_t zypp::filesystem::Glob::size_type |
typedef const char* zypp::filesystem::Glob::value_type |
Individual bits to combine in Flags.
Enumerator | |
---|---|
kErr | Return on read errors. |
kMark | Append a slash to each name. |
kNoSort | Don't sort the names. |
kNoCheck | If nothing matches, return the pattern. |
kNoEscape | Backslashes don't quote metacharacters. |
kPeriod | Leading ‘.’ can be matched by metachars. |
kAltDirFunc | Use gl_opendir et al functions. |
kBrace | Expand "{a,b}" to "a" "b". |
kNoMagic | If no magic chars, return the pattern. |
kTilde | Expand ~user and ~ to home directories. |
kOnlyDir | Match only directories. |
kTildeCheck | Like GLOB_TILDE but return an error if the user name is not available. |
|
inline |
Default ctor optionally taking the default flags.
The flags passed here are the default for add.
|
inlineexplicit |
Ctor adding pathnames matching pattern_r.
The flags passed here are the default for add.
|
inlineexplicit |
|
inlineexplicit |
zypp::filesystem::Glob::ZYPP_DECLARE_FLAGS | ( | Flags | , |
Bits | |||
) |
type Flags: Type-safe OR-combination of Bits.
|
inline |
Add pathnames matching pattern_r to the current result.
Any flags passed here override the global default passed to the ctor. GLOB_APPEND is atomatically added to the flags f needed.
This invalidates all iterators.
|
inline |
int zypp::filesystem::Glob::add | ( | const char * | pattern_r, |
Flags | flags_r = Flags() |
||
) |
void zypp::filesystem::Glob::clear | ( | ) |
|
inline |
Clear all results and reset defaultFlags.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
related |
|
private |
|
private |