]> git.lyx.org Git - lyx.git/blob - src/output.C
cleanup after svn hang-up, #undef CursorShape. Should be compilable ganin now.
[lyx.git] / src / output.C
1 /**
2  * \file output.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "output.h"
14
15 #include "gettext.h"
16
17 #include "frontends/Alert.h"
18
19 #include "support/filetools.h"
20
21 #include <fstream>
22
23 using lyx::support::bformat;
24 using lyx::support::makeDisplayPath;
25
26 using lyx::docstring;
27
28 using std::ofstream;
29 using std::string;
30
31 bool openFileWrite(ofstream & ofs, string const & fname)
32 {
33         ofs.open(fname.c_str());
34         if (!ofs) {
35                 docstring const file = makeDisplayPath(fname, 50);
36                 docstring text = bformat(_("Could not open the specified "
37                                                      "document\n%1$s."), file);
38                 Alert::error(_("Could not open file"), text);
39                 return false;
40         }
41         return true;
42 }