$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Rich Johnson (rjohnson_at_[hidden])
Date: 2004-01-13 18:45:23
Folks--
Is there general interest in a "globbing" iterator?
If so I've got one I'm willing to re-package for submission.
(Or at least discuss with folks for improvement)
If you're interested, read on:
glob_iterator aggregates a directory_iterator and regex to provide
shell-style "*", "?", "{....}", "[....]" and "[^...]" wildcarding.
boost components used:
filesystem::directory_iterator
filesystem::path
filter_iterator
reg_expression
c_regex_traits
Usage example:
//...do something to all .cpp and .c files
glob_iterator start( "*.{c,cpp}" );
glob_iterator end;
while( start != end ){
std::string filename( start->leaf() );
//...do something with/to filename
++start;
}