3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS.
17 #include "frontends/Alert.h"
19 #include "support/filetools.h"
24 using support::bformat;
25 using support::makeDisplayPath;
32 template<typename OFStream>
33 bool doOpenFileWrite(OFStream & ofs, string const & fname)
35 ofs.open(fname.c_str());
37 docstring const file = makeDisplayPath(fname, 50);
38 docstring text = bformat(_("Could not open the specified "
39 "document\n%1$s."), file);
40 frontend::Alert::error(_("Could not open file"), text);
49 bool openFileWrite(ofstream & ofs, string const & fname)
51 return doOpenFileWrite(ofs, fname);
55 bool openFileWrite(odocfstream & ofs, string const & fname)
57 return doOpenFileWrite(ofs, fname);