Mailinglist Archive: zypp-devel (59 mails)

< Previous Next >
[zypp-devel] Added zypp::Glob - Find pathnames matching a pattern.
  • From: Michael Andres <ma@xxxxxxx>
  • Date: Wed, 19 Nov 2008 15:13:20 +0100
  • Message-id: <200811191513.20969.ma@xxxxxxx>

JFYI: I added a small wrapper around ::glob. It's available in
zypp/Glob.h. You can easily collect multiple patterns and iterate
the result.

Glob glob( Glob::_BRACE );
glob.add( "/somewhere/solverTestcase/ *{.xml,.xml.gz}" );
glob.add( "/somewhere/else/a*" );
for_( it, glob.begin(), glob.end() )
...


There is also a static Glob::collect method that sends the result to some
container. The containers value type must be constructible from a const char*:

std::list<Pathname> plist;
Glob::collect( "/somewherre/solverTestcase/*{.xml,.xml.gz}", Glob::_BRACE,
std::back_inserter( plist ) );

--

cu,
Michael Andres

+------------------------------------------------------------------+
Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4
+------------------------------------------------------------------+
Michael Andres YaST Development ma@xxxxxxxxxx
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0
+------------------------------------------------------------------+

--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages