]> git.lyx.org Git - lyx.git/blob - src/support/copy.C
use more unicode in math
[lyx.git] / src / support / copy.C
1 /**
2  * \file copy.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include <fstream>
14
15 #include "support/lyxlib.h"
16
17
18 namespace lyx {
19
20
21 using std::ifstream;
22 using std::ofstream;
23 using std::ios;
24 using std::string;
25
26
27 bool lyx::support::copy(string const & from, string const & to)
28 {
29         ifstream ifs(from.c_str(), ios::binary | ios::in);
30         if (!ifs)
31                 return false;
32
33         ofstream ofs(to.c_str(), ios::binary | ios::out | ios::trunc);
34         if (!ofs)
35                 return false;
36
37         ofs << ifs.rdbuf();
38         return ofs.good();
39 }
40
41
42 } // namespace lyx