]> git.lyx.org Git - lyx.git/blob - src/support/copy.C
small cleanup, doxygen, formatting changes
[lyx.git] / src / support / copy.C
1 #include <config.h>
2
3 #include <fstream>
4
5 #include "support/lyxlib.h"
6 #include "LString.h"
7
8 bool lyx::copy(string const & from, string const & to)
9 {
10         std::ifstream ifs(from.c_str());
11         if (!ifs) return false;
12         std::ofstream ofs(to.c_str(), std::ios::out|std::ios::trunc);
13         if (!ofs) return false;
14         ofs << ifs.rdbuf();
15         if (ofs.good()) return true;
16         return false;
17 }