]> git.lyx.org Git - lyx.git/blobdiff - src/support/copy.C
Make it possible to uses non-ascii labelstring, endlabelstring and
[lyx.git] / src / support / copy.C
index 306d788cc7ba3750335ded6e89ecd92b3d2aa1d5..2d994b8450e91549589467c5c5b5c30b40fd3e39 100644 (file)
 #include <fstream>
 
 #include "support/lyxlib.h"
-#include "support/std_string.h"
+
+
+namespace lyx {
+
 
 using std::ifstream;
 using std::ofstream;
 using std::ios;
+using std::string;
+
 
 bool lyx::support::copy(string const & from, string const & to)
 {
-       ifstream ifs(from.c_str());
+       ifstream ifs(from.c_str(), ios::binary | ios::in);
        if (!ifs)
                return false;
-       ofstream ofs(to.c_str(),
-                    ios::binary | ios::out | ios::trunc);
+
+       ofstream ofs(to.c_str(), ios::binary | ios::out | ios::trunc);
        if (!ofs)
                return false;
+
        ofs << ifs.rdbuf();
-       if (ofs.good())
-               return true;
-       return false;
+       return ofs.good();
 }
+
+
+} // namespace lyx