#include "support/FileInfo.h"
#include "support/lyxmanip.h"
#include "support/lyxtime.h"
+#include "support/gzstream.h"
#include <boost/bind.hpp>
#include <boost/tuple/tuple.hpp>
namespace {
-const int LYX_FORMAT = 224;
+const int LYX_FORMAT = 225;
bool openFileWrite(ofstream & ofs, string const & fname)
{
return false;
}
+ bool const compressed = (fname.substr(fname.size() - 3, 3) == ".gz");
+
+ if (compressed) {
+ gz::ogzstream ofs(fname.c_str());
+
+ if (!ofs)
+ return false;
+
+ return do_writeFile(ofs);
+
+ }
+
ofstream ofs(fname.c_str());
if (!ofs)
return false;
+ return do_writeFile(ofs);
+}
+
+
+bool Buffer::do_writeFile(ostream & ofs) const
+{
+
#ifdef HAVE_LOCALE
// Use the standard "C" locale for file output.
ofs.imbue(std::locale::classic());
// Write marker that shows file is complete
ofs << "\n\\the_end" << endl;
- ofs.close();
+ // Shouldn't really be needed....
+ //ofs.close();
// how to check if close went ok?
// Following is an attempt... (BE 20001011)