#include "support/FileInfo.h"
#include "support/filetools.h"
-#include "support/gzstream.h"
+#ifdef USE_COMPRESSION
+# include "support/gzstream.h"
+#endif
#include "support/lyxlib.h"
#include "support/os.h"
#include "support/path.h"
#include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <boost/bind.hpp>
#include <iomanip>
#include <stack>
#include <sstream>
+#include <fstream>
using lyx::pos_type;
namespace {
-int const LYX_FORMAT = 238;
+int const LYX_FORMAT = 239;
} // namespace anon
typedef std::map<string, bool> DepClean;
-struct Buffer::Impl
+class Buffer::Impl
{
+public:
Impl(Buffer & parent, string const & file, bool readonly);
limited_stack<Undo> undostack;
string unknown = params().readToken(lex, token);
if (!unknown.empty()) {
- if (unknown[0] != '\\' and token == "\\textclass") {
+ if (unknown[0] != '\\' && token == "\\textclass") {
unknownClass(unknown);
} else {
++unknown_tokens;
filename));
return false;
}
- string command = LibFileSearch("lyx2lyx", "lyx2lyx");
+ string command =
+ "python " + LibFileSearch("lyx2lyx", "lyx2lyx");
if (command.empty()) {
Alert::error(_("Conversion script not found"),
bformat(_("%1$s is from an earlier"
return false;
}
command += " -t"
- + tostr(LYX_FORMAT)
+ + convert<string>(LYX_FORMAT)
+ " -o " + tmpfile + ' '
+ QuoteName(filename);
lyxerr[Debug::INFO] << "Running '"
bool retval = false;
if (params().compressed) {
+#ifdef USE_COMPRESSION
gz::ogzstream ofs(fname.c_str());
if (!ofs)
return false;
retval = do_writeFile(ofs);
-
+#else
+ return false;
+#endif
} else {
ofstream ofs(fname.c_str());
if (!ofs)
}
+#ifdef WITH_WARNINGS
#warning this function should be moved to buffer_pimpl.C
+#endif
void Buffer::markDirty()
{
if (pimpl_->lyx_clean) {