1 #include "directory.hpp"
5 std::set
<std::string
> enumerate_directory(const std::string
& dir
, const std::string
& match
)
7 std::set
<std::string
> x
;
10 d
= opendir(dir
.c_str());
12 (stringfmt() << "Can't read directory '" << dir
<< "'").throwex();
15 while((d2
= readdir(d
)))
16 if(regex_match(match
, d2
->d_name
) && strcmp(d2
->d_name
, ".") && strcmp(d2
->d_name
, ".."))
17 x
.insert(dir
+ "/" + d2
->d_name
);