X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Foutput.C;h=ab1177b974e7c1aa790884984713bea7f0d042d3;hb=61c43883ba1b97e0d7f21cbd275a7b9c0cec9de5;hp=fbdef6bbbb60579bbd40dd4c19e32429ad5a88e0;hpb=6ada61e182f55c612b4d743f37b14c10d032ccad;p=lyx.git diff --git a/src/output.C b/src/output.C index fbdef6bbbb..ab1177b974 100644 --- a/src/output.C +++ b/src/output.C @@ -18,25 +18,44 @@ #include "support/filetools.h" -#include -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 +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); - lyx::frontend::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