static void loadExcludes(std::set<std::string> & x, const bf::path & ePath) { using namespace bf; if (!exists(ePath)) throw std::logic_error(fmt::format("exclude file list path doesn't exists '{}'", ePath.string())); std::ifstream f( ePath.c_str() ); if (!f.is_open()) throw std::logic_error(fmt::format("error while opening exclude list file '{}'", ePath.string())); std::string line; while(getline(f, line)) { line = boost::trim_copy(line); if (line.empty()) continue; x.insert(line); } if (f.bad()) throw std::logic_error(fmt::format("error while reading exclude list file '{}'", ePath.string())); }
~download_content() { if (local_file_!=target_file_ && delete_temp_file_) unlink(local_file_.c_str()); }