|
libzypp
17.7.0
|
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. More... | |
| Glob (Flags flags_r=Flags()) | |
| Default ctor optionally taking the default flags. More... | |
| Glob (const Pathname &pattern_r, Flags flags_r=Flags()) | |
| Ctor adding pathnames matching pattern_r. More... | |
| Glob (const std::string &pattern_r, Flags flags_r=Flags()) | |
| Glob (const char *pattern_r, Flags flags_r=Flags()) | |
| ~Glob () | |
| Dtor. More... | |
| int | add (const Pathname &pattern_r, Flags flags_r=Flags()) |
| Add pathnames matching pattern_r to the current result. More... | |
| int | add (const std::string &pattern_r, Flags flags_r=Flags()) |
| int | add (const char *pattern_r, Flags flags_r=Flags()) |
| void | clear () |
| Clear all results found so far. More... | |
| void | reset (Flags flags_r=Flags()) |
| Clear all results and reset defaultFlags. More... | |
| Flags | defaultFlags () const |
The default flags passed to ::glob(). More... | |
| void | setDefaultFlags (Flags flags_r=Flags()) |
Set the default flags passed to ::glob(). More... | |
| int | lastGlobReturn () const |
Returns the value returned by the last call to ::glob(). More... | |
| bool | empty () const |
| Whether matches were found. More... | |
| size_type | size () const |
| The number of matches found so far. More... | |
| const_iterator | begin () const |
| Iterator pointing to the first result. More... | |
| const_iterator | end () const |
| Iterator pointing behind the last result. More... | |
Static Public Member Functions | |
Collecting Glob results to some TOutputIterator | |
std::list<Pathname> p; Glob::collect( "/bin/a*.dat}", std::back_inserter(p) ); | |
| template<class TOutputIterator > | |
| static int | collect (const Pathname &pattern_r, TOutputIterator result_r) |
Write glob result to some OutputIterator. More... | |
| template<class TOutputIterator > | |
| static int | collect (const std::string &pattern_r, TOutputIterator result_r) |
| template<class TOutputIterator > | |
| static int | collect (const char *pattern_r, TOutputIterator result_r) |
| 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) |
| template<class TOutputIterator > | |
| static int | collect (const char *pattern_r, Flags flags_r, TOutputIterator result_r) |
Private Attributes | |
| Flags | _defaultFlags |
| scoped_ptr< ::glob_t > | _result |
| DefaultIntegral< int, 0 > | _lastGlobReturn |
Related Functions | |
(Note that these are not member functions.) | |
| std::ostream & | operator<< (std::ostream &str, const Glob &obj) |
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 |