X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Foutput.C;h=7b19e0b0911c2b2a9422b4e89d935f2f8a74d91f;hb=e5a46922e916a06ad1b958d5895cc3cfb4f13d2c;hp=e946cb2b820b1a221ef913ed04c0b3d33ece1873;hpb=34b7650cbbe6a9ed2de812e75771451b8c8fe983;p=lyx.git diff --git a/src/output.C b/src/output.C index e946cb2b82..7b19e0b091 100644 --- a/src/output.C +++ b/src/output.C @@ -18,11 +18,12 @@ #include "support/filetools.h" -using lyx::odocfstream; -using lyx::support::bformat; -using lyx::support::makeDisplayPath; -using lyx::docstring; +namespace lyx { + +using support::bformat; +using support::FileName; +using support::makeDisplayPath; using std::ofstream; using std::string; @@ -30,14 +31,14 @@ using std::string; namespace { template -bool doOpenFileWrite(OFStream & ofs, string const & fname) +bool doOpenFileWrite(OFStream & ofs, FileName const & fname) { - ofs.open(fname.c_str()); + ofs.open(fname.toFilesystemEncoding().c_str()); if (!ofs) { - docstring const file = makeDisplayPath(fname, 50); + docstring const file = makeDisplayPath(fname.absFilename(), 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; @@ -46,13 +47,16 @@ bool doOpenFileWrite(OFStream & ofs, string const & fname) } -bool openFileWrite(ofstream & ofs, string const & fname) +bool openFileWrite(ofstream & ofs, FileName const & fname) { return doOpenFileWrite(ofs, fname); } -bool openFileWrite(odocfstream & ofs, string const & fname) +bool openFileWrite(odocfstream & ofs, FileName const & fname) { return doOpenFileWrite(ofs, fname); } + + +} // namespace lyx