/** * \file filenames_manipulation.h * \brief Generation of projections using the central section theorem * Copyright 2007-2010 IMP Inventors. All rights reserved. */ #ifndef IMPEM2D_FILENAMES_MANIPULATION_H #define IMPEM2D_FILENAMES_MANIPULATION_H #include "IMP/exception.h" #include #include #include IMPEM2D_BEGIN_NAMESPACE //! Reads a selection file, first column is a file name second is 1 if the //! file is selected, 0 if ignored inline Strings read_selection_file(String fn) { String name; Strings names; std::ifstream in; int not_ignored; in.open(fn.c_str(), std::ios::in); if (!in) { IMP_THROW("Unable to read file " << fn, IOException); } while(in >> name >> not_ignored) { if (not_ignored) { names.push_back(name); } } in.close(); return names; } //! generates consecutive filenames: basic_name-i.extension //inline Strings generate_filenames(unsigned long number, // String basic_name, String extension) { // Strings proj_names(number); // for (unsigned int i=0;i