src/artm/core/helpers.cc
// Return the filenames of all files that have the specified extension
// in the specified directory.
Return the filenames of all files that have the specified extension
in the specified directory.
Return the filenames of all files that have the specified extension in the specified directory .
std::vector<boost::uuids::uuid> BatchHelpers::ListAllBatches(const boost::filesystem::path& root) {
  std::vector<boost::uuids::uuid> uuids;
  if (boost::filesystem::exists(root) && boost::filesystem::is_directory(root)) {
    boost::filesystem::recursive_directory_iterator it(root);
    boost::filesystem::recursive_directory_iterator endit;
    while (it != endit) {
      if (boost::filesystem::is_regular_file(*it) && it->path().extension() == kBatchExtension) {
        std::string filename = it->path().filename().stem().string();
        boost::uuids::uuid uuid = boost::uuids::string_generator()(filename);
        if (uuid.is_nil()) {
          LOG(WARNING) << "Unable to convert filename " << filename << " to uuid.";
          continue;
        }
        uuids.push_back(uuid);
      }
      ++it;
    }
  }
  return uuids;
}
std :: vector < boost :: uuids :: uuid > BatchHelpers :: ListAllBatches ( const boost :: filesystem :: path & root ) { std :: vector < boost :: uuids :: uuid > uuids ; if ( boost :: filesystem :: exists ( root ) && boost :: filesystem :: is_directory ( root ) ) { boost :: filesystem :: recursive_directory_iterator it ( root ) ; boost :: filesystem :: recursive_directory_iterator endit ; while ( it != endit ) { if ( boost :: filesystem :: is_regular_file ( * it ) && it -> path ( ) . extension ( ) == kBatchExtension ) { std :: string filename = it -> path ( ) . filename ( ) . stem ( ) . string ( ) ; boost :: uuids :: uuid uuid = boost :: uuids :: string_generator ( ) ( filename ) ; if ( uuid . is_nil ( ) ) { LOG ( WARNING ) << " " << filename << " " ; continue ; } uuids . push_back ( uuid ) ; } ++ it ; } } return uuids ; }
Return the filenames of all files that have the specified extension
in the specified directory.
Return the filenames of all files that have the specified extension in the specified directory .