mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
add hooks for visiting netdb
This commit is contained in:
parent
28fdd992c9
commit
fec49e5609
4 changed files with 35 additions and 3 deletions
9
FS.cpp
9
FS.cpp
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue