diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-10 14:04:43 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-10 14:04:43 +0400 |
commit | 5d600f2b50e918c9b16ef8fcc735c8aa8daaa5ce (patch) | |
tree | 2299060657217bf91eac18e905f15c7922505df1 /mert/ScoreArray.h | |
parent | 3ce46da4cd4c9c7779401548accf235f0c331059 (diff) |
Remove hard-coded "/dev/stdout".
This will improve the portability.
We also change the interface of I/O functions for ease of the
development unit tests.
Diffstat (limited to 'mert/ScoreArray.h')
-rw-r--r-- | mert/ScoreArray.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/mert/ScoreArray.h b/mert/ScoreArray.h index e1fb71357..70d7ec0e6 100644 --- a/mert/ScoreArray.h +++ b/mert/ScoreArray.h @@ -95,17 +95,15 @@ public: m_num_scores = v; } - void savetxt(ofstream& outFile, const std::string& sctype); - void savebin(ofstream& outFile, const std::string& sctype); - void save(ofstream& outFile, const std::string& sctype, bool bin=false); - void save(const std::string &file, const std::string& sctype, bool bin=false); - inline void save(const std::string& sctype, bool bin=false) { - save("/dev/stdout", sctype, bin); - } - - void loadtxt(ifstream& inFile, size_t n); - void loadbin(ifstream& inFile, size_t n); - void load(ifstream& inFile); + void savetxt(std::ostream* os, const std::string& score_type); + void savebin(std::ostream* os, const std::string& score_type); + void save(std::ostream* os, const std::string& score_type, bool bin=false); + void save(const std::string &file, const std::string& score_type, bool bin=false); + void save(const std::string& score_type, bool bin=false); + + void loadtxt(std::istream* is, size_t n); + void loadbin(std::istream* is, size_t n); + void load(std::istream* is); void load(const std::string &file); bool check_consistency() const; |