26 #include <zypp-core/base/DefaultIntegral> 68 , boost::forward_traversal_tag
82 friend class boost::iterator_core_access;
85 if ( base_reference() && !*(++base_reference()) )
89 {
return( base() ? *base() : 0 ); }
98 kNoSort = GLOB_NOSORT,
100 kNoCheck = GLOB_NOCHECK,
102 kNoEscape = GLOB_NOESCAPE,
103 kPeriod = GLOB_PERIOD,
105 kAltDirFunc = GLOB_ALTDIRFUNC,
107 kNoMagic = GLOB_NOMAGIC,
109 kOnlyDir = GLOB_ONLYDIR,
110 kTildeCheck = GLOB_TILDE_CHECK,
121 Glob( Flags flags_r = Flags() )
122 : _defaultFlags( flags_r )
130 : _defaultFlags( flags_r )
131 { add( pattern_r, flags_r ); }
133 explicit Glob(
const std::string & pattern_r, Flags flags_r = Flags() )
134 : _defaultFlags( flags_r )
135 { add( pattern_r, flags_r ); }
137 explicit Glob(
const char * pattern_r, Flags flags_r = Flags() )
138 : _defaultFlags( flags_r )
139 { add( pattern_r, flags_r ); }
156 {
return add( pattern_r.
c_str(), flags_r ); }
158 int add(
const std::string & pattern_r, Flags flags_r = Flags() )
159 {
return add( pattern_r.c_str(), flags_r ); }
161 int add(
const char * pattern_r, Flags flags_r = Flags() );
167 void reset( Flags flags_r = Flags() )
168 { clear(); setDefaultFlags( flags_r ); }
174 {
return _defaultFlags; }
178 { _defaultFlags = flags_r; }
185 {
return _lastGlobReturn; }
215 template<
class TOutputIterator>
217 {
return collect( pattern_r.
c_str(), Flags(), result_r ); }
219 template<
class TOutputIterator>
220 static int collect(
const std::string & pattern_r, TOutputIterator result_r )
221 {
return collect( pattern_r.c_str(), Flags(), result_r ); }
223 template<
class TOutputIterator>
224 static int collect(
const char * pattern_r, TOutputIterator result_r )
225 {
return collect( pattern_r, Flags(), result_r ); }
228 template<
class TOutputIterator>
229 static int collect(
const Pathname & pattern_r, Flags flags_r, TOutputIterator result_r )
230 {
return collect( pattern_r.
c_str(), flags_r, result_r ); }
232 template<
class TOutputIterator>
233 static int collect(
const std::string & pattern_r, Flags flags_r, TOutputIterator result_r )
234 {
return collect( pattern_r.c_str(), flags_r, result_r ); }
236 template<
class TOutputIterator>
237 static int collect(
const char * pattern_r, Flags flags_r, TOutputIterator result_r )
239 Glob glob( pattern_r, flags_r );
242 (*result_r)++ =
typename TOutputIterator::container_type::value_type(*it);
259 {
return str << *obj; }
271 #endif // ZYPP_GLOB_H
ZYPP_DECLARE_FLAGS(VendorSupportOptions, VendorSupportOption)
const_iterator(char **_idx)
static int collect(const Pathname &pattern_r, TOutputIterator result_r)
Write glob result to some OutputIterator.
static int collect(const std::string &pattern_r, TOutputIterator result_r)
scoped_ptr< ::glob_t > _result
std::enable_if_t<!std::is_same_v< void, T >, expected< Container< T >, E > > collect(Container< expected< T, E >, CArgs... > &&in)
Iterate NULL terminated char* array.
static int collect(const std::string &pattern_r, Flags flags_r, TOutputIterator result_r)
std::ostream & operator<<(std::ostream &str, const Glob::const_iterator &obj)
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Flags defaultFlags() const
The default flags passed to ::glob().
const char * c_str() const
String representation.
static int collect(const char *pattern_r, TOutputIterator result_r)
String related utilities and Regular expression matching.
Glob(const char *pattern_r, Flags flags_r=Flags())
DefaultIntegral< int, 0 > _lastGlobReturn
size_type size() const
The number of matches found so far.
const_iterator begin() const
Iterator pointing to the first result.
int lastGlobReturn() const
Returns the value returned by the last call to ::glob().
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())
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
void reset(Flags flags_r=Flags())
Clear all results and reset defaultFlags.
bool empty() const
Whether matches were found.
Find pathnames matching a pattern.
Glob(Flags flags_r=Flags())
Default ctor optionally taking the default flags.
int add(const Pathname &pattern_r, Flags flags_r=Flags())
Add pathnames matching pattern_r to the current result.
Bits
Individual bits to combine in Flags.
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(Glob::Flags)
reference dereference() const
void setDefaultFlags(Flags flags_r=Flags())
Set the default flags passed to ::glob().
const_iterator end() const
Iterator pointing behind the last result.
std::ostream & operator<<(std::ostream &str, const Glob &obj)
Easy-to use interface to the ZYPP dependency resolver.
static int collect(const char *pattern_r, Flags flags_r, TOutputIterator result_r)
ZYppCommitResult & _result
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
int add(const std::string &pattern_r, Flags flags_r=Flags())
static int collect(const Pathname &pattern_r, Flags flags_r, TOutputIterator result_r)