add hooks for visiting netdb

This commit is contained in:
Jeff Becker 2016-08-29 14:16:29 -04:00
parent 28fdd992c9
commit fec49e5609
No known key found for this signature in database
GPG key ID: AB950234D6EA286B
4 changed files with 35 additions and 3 deletions

9
FS.cpp
View file

@ -158,6 +158,13 @@ namespace fs {
}
void HashedStorage::Traverse(std::vector<std::string> & files) {
Iterate([&files] (const std::string & fname) {
files.push_back(fname);
});
}
void HashedStorage::Iterate(FilenameVisitor v)
{
boost::filesystem::path p(root);
boost::filesystem::recursive_directory_iterator it(p);
boost::filesystem::recursive_directory_iterator end;
@ -166,7 +173,7 @@ namespace fs {
if (!boost::filesystem::is_regular_file( it->status() ))
continue;
const std::string & t = it->path().string();
files.push_back(t);
v(t);
}
}
} // fs