]> git.lyx.org Git - lyx.git/blobdiff - src/output.C
Introduce wide streams. This fixes the remaining problems of plain text
[lyx.git] / src / output.C
index fbdef6bbbb60579bbd40dd4c19e32429ad5a88e0..e946cb2b820b1a221ef913ed04c0b3d33ece1873 100644 (file)
@@ -18,8 +18,7 @@
 
 #include "support/filetools.h"
 
-#include <fstream>
-
+using lyx::odocfstream;
 using lyx::support::bformat;
 using lyx::support::makeDisplayPath;
 
@@ -28,7 +27,10 @@ using lyx::docstring;
 using std::ofstream;
 using std::string;
 
-bool openFileWrite(ofstream & ofs, string const & fname)
+namespace {
+
+template<typename OFStream>
+bool doOpenFileWrite(OFStream & ofs, string const & fname)
 {
        ofs.open(fname.c_str());
        if (!ofs) {
@@ -40,3 +42,17 @@ bool openFileWrite(ofstream & ofs, string const & fname)
        }
        return true;
 }
+
+}
+
+
+bool openFileWrite(ofstream & ofs, string const & fname)
+{
+       return doOpenFileWrite(ofs, fname);
+}
+
+
+bool openFileWrite(odocfstream & ofs, string const & fname)
+{
+       return doOpenFileWrite(ofs, fname);
+}