void FeatureArray::save(ostream* os, bool bin) { if (size() <= 0) return; if (bin) { savebin(os); } else { savetxt(os); } }
void ScoreArray::save(ostream* os, const string& score_type, bool bin) { if (size() <= 0) return; if (bin) { savebin(os, score_type); } else { savetxt(os, score_type); } }
void AbstractCorrelator::savetxt (string_ref filename) { std::ofstream ofs (filename); if (!ofs) rt_error ("cannot open file: " + filename); savetxt (ofs); if (!ofs) rt_error ("error writing data: " + filename); ofs.close (); if (!ofs) rt_error ("error writing data (2): " + filename); }
void ScoreStats::savetxt() { savetxt(&cout); }
void ScoreStats::savetxt(const string &file) { ofstream ofs(file.c_str(), ios::out); // matches a stream with a file. Opens the file ostream* os = &ofs; savetxt(os); }
void ScoreArray::save(std::ofstream& inFile, const std::string& sctype, bool bin) { if (size()>0) (bin)?savebin(inFile, sctype):savetxt(inFile, sctype); }
void FeatureStats::savetxt() { savetxt(&cout); }
void FeatureStats::savetxt(const string &file) { ofstream ofs(file.c_str(), ios::out); ostream* os = &ofs; savetxt(os); }