68 , boost::forward_traversal_tag
85 if ( base_reference() && !*(++base_reference()) )
89 {
return( base() ? *base() : 0 ); }
133 explicit Glob(
const std::string & pattern_r, Flags
flags_r = Flags() )
137 explicit Glob(
const char * pattern_r, Flags
flags_r = Flags() )
155 int add(
const Pathname & pattern_r, Flags
flags_r = Flags() )
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() );
215 template<
class _OutputIterator>
217 {
return collect( pattern_r.
c_str(), Flags(), result_r ); }
219 template<
class _OutputIterator>
220 static int collect(
const std::string & pattern_r, _OutputIterator result_r )
221 {
return collect( pattern_r.c_str(), Flags(), result_r ); }
223 template<
class _OutputIterator>
224 static int collect(
const char * pattern_r, _OutputIterator result_r )
225 {
return collect( pattern_r, Flags(), result_r ); }
228 template<
class _OutputIterator>
232 template<
class _OutputIterator>
233 static int collect(
const std::string & pattern_r, Flags
flags_r, _OutputIterator result_r )
236 template<
class _OutputIterator>
237 static int collect(
const char * pattern_r, Flags
flags_r, _OutputIterator result_r )
239 Glob glob( pattern_r, flags_r );
242 (*result_r)++ =
typename _OutputIterator::container_type::value_type(*it);
255 std::ostream &
operator<<( std::ostream & str,
const Glob & obj );
259 {
return str << *obj; }
271 #endif // ZYPP_GLOB_H
static int collect(const char *pattern_r, Flags flags_r, _OutputIterator result_r)
const_iterator(char **_idx)
scoped_ptr< ::glob_t > _result
Iterate NULL terminated char* array.
Don't sort the names.
static int collect(const std::string &pattern_r, _OutputIterator result_r)
std::ostream & operator<<(std::ostream &str, const Glob::const_iterator &obj)
int lastGlobReturn() const
Returns the value returned by the last call to ::glob().
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
static int collect(const std::string &pattern_r, Flags flags_r, _OutputIterator result_r)
Leading `.' can be matched by metachars.
DefaultIntegral< int, 0 > _lastGlobReturn
Use gl_opendir et al functions.
Backslashes don't quote metacharacters.
Flags defaultFlags() const
The default flags passed to ::glob().
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
If nothing matches, return the pattern.
Expand ~user and ~ to home directories.
const char * c_str() const
String representation.
void reset(Flags flags_r=Flags())
Clear all results and reset defaultFlags.
If no magic chars, return the pattern.
static int collect(const char *pattern_r, _OutputIterator result_r)
Expand "{a,b}" to "a" "b".
Find pathnames matching a pattern.
bool empty() const
Whether matches were found.
const_iterator begin() const
Iterator pointing to the first result.
Append a slash to each name.
const_iterator end() const
Iterator pointing behind the last result.
reference dereference() const
Bits
Individual bits to combine in Flags.
static int collect(const Pathname &pattern_r, Flags flags_r, _OutputIterator result_r)
friend class boost::iterator_core_access
ZYPP_DECLARE_OPERATORS_FOR_FLAGS(Glob::Flags)
Like GLOB_TILDE but return an error if the user name is not available.
ZYPP_DECLARE_FLAGS(Flags, Bits)
type Flags: Type-safe OR-combination of Bits.
void setDefaultFlags(Flags flags_r=Flags())
Set the default flags passed to ::glob().
size_type size() const
The number of matches found so far.
std::ostream & operator<<(std::ostream &str, const Glob &obj)
static int collect(const Pathname &pattern_r, _OutputIterator result_r)
Write glob result to some OutputIterator.
void clear()
Clear all results found so far.