Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by aljen ( 13 years ago )
boost::filesystem::path p(fromDirectory);
if (!boost::filesystem::exists(p) || !boost::filesystem::is_directory(p))
  return;

std::vector<boost::filesystem::path> paths;
std::copy(boost::filesystem::recursive_directory_iterator(p), boost::filesystem::recursive_directory_iterator(), std::back_inserter(paths));

auto pathsEnd = std::remove_if(paths.begin(), paths.end(),
  [](boost::filesystem::path& path) {
    return boost::filesystem::is_directory(path);
  }
);
paths.erase(pathsEnd, paths.end());
std::sort(paths.begin(), paths.end());

 

Revise this Paste

Your Name: Code Language: