]> git.lyx.org Git - lyx.git/blobdiff - src/output.C
hopefully fix tex2lyx linking.
[lyx.git] / src / output.C
index e45640df36684daf5f246de69fce3f7eeb83c80f..ab1177b974e7c1aa790884984713bea7f0d042d3 100644 (file)
 
 #include "support/filetools.h"
 
-#include <fstream>
 
-using lyx::support::bformat;
-using lyx::support::makeDisplayPath;
+namespace lyx {
 
-using lyx::docstring;
+using support::bformat;
+using support::makeDisplayPath;
 
 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) {
                docstring const file = makeDisplayPath(fname, 50);
                docstring text = bformat(_("Could not open the specified "
                                                     "document\n%1$s."), file);
-               Alert::error(_("Could not open file"), text);
+               frontend::Alert::error(_("Could not open file"), text);
                return false;
        }
        return true;
 }
+
+}
+
+
+bool openFileWrite(ofstream & ofs, string const & fname)
+{
+       return doOpenFileWrite(ofs, fname);
+}
+
+
+bool openFileWrite(odocfstream & ofs, string const & fname)
+{
+       return doOpenFileWrite(ofs, fname);
+}
+
+
+} // namespace lyx