diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-18 21:26:55 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-08-18 21:26:55 +0000 |
commit | 8ec14f00d1078f0fa7ab3ba2a01954b1f6ca5260 (patch) | |
tree | 2c065af3a449a50eccb1c30d140bf21a324c850d /utils/filelib.h | |
parent | 0017c952afb4076025098165414d8ca745107f2b (diff) |
ValueArray instead of string for state - same LM decode scores
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@593 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'utils/filelib.h')
-rw-r--r-- | utils/filelib.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/utils/filelib.h b/utils/filelib.h index b9fef9a7..dda98671 100644 --- a/utils/filelib.h +++ b/utils/filelib.h @@ -103,4 +103,18 @@ class WriteFile : public BaseFile<std::ostream> { } }; +inline void CopyFile(std::istream &in,std::ostream &out) { + out << in.rdbuf(); +} + +inline void CopyFile(std::string const& inf,std::ostream &out) { + ReadFile r(inf); + CopyFile(*r,out); +} + +inline void CopyFile(std::string const& inf,std::string const& outf) { + WriteFile w(outf); + CopyFile(inf,*w); +} + #endif |