summaryrefslogtreecommitdiff
path: root/utils/filelib.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/filelib.h')
-rw-r--r--utils/filelib.h14
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