]> git.lyx.org Git - lyx.git/blobdiff - src/support/gzstream.h
Account for old versions of Pygments
[lyx.git] / src / support / gzstream.h
index 3c4568d6847dd94dc504c3cca8b959458b050606..b40e8a18e6541c7935fa673173418764f5041b93 100644 (file)
@@ -32,9 +32,7 @@
 // standard C++ with new header file names and std:: namespace
 #include <iostream>
 #include <fstream>
-#ifdef HAVE_ZLIB_H
-# include <zlib.h>
-#endif
+#include <zlib.h>
 
 // For LyX
 #define GZSTREAM_NAMESPACE gz
@@ -59,12 +57,12 @@ private:
 
     int flush_buffer();
 public:
-    gzstreambuf() : opened(0) {
-       setp( buffer, buffer + (bufferSize-1));
-       setg( buffer + 4,     // beginning of putback area
-             buffer + 4,     // read position
-             buffer + 4);    // end position
-       // ASSERT: both input & output capabilities will not be used together
+    gzstreambuf() : file(0), opened(0), mode(0) {
+        setp( buffer, buffer + (bufferSize-1));
+        setg( buffer + 4,     // beginning of putback area
+              buffer + 4,     // read position
+              buffer + 4);    // end position
+        // ASSERT: both input & output capabilities will not be used together
     }
     int is_open() { return opened; }
     gzstreambuf* open( const char* name, int open_mode);
@@ -98,10 +96,10 @@ class igzstream : public gzstreambase, public std::istream {
 public:
     igzstream() : std::istream( &buf) {}
     igzstream( const char* name, int open_mode = std::ios::in)
-       : gzstreambase( name, open_mode), std::istream( &buf) {}
+        : gzstreambase( name, open_mode), std::istream( &buf) {}
     gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); }
     void open( const char* name, int open_mode = std::ios::in) {
-       gzstreambase::open( name, open_mode);
+        gzstreambase::open( name, open_mode);
     }
 };
 
@@ -109,10 +107,10 @@ class ogzstream : public gzstreambase, public std::ostream {
 public:
     ogzstream() : std::ostream( &buf) {}
     ogzstream( const char* name, int mode = std::ios::out)
-       : gzstreambase( name, mode), std::ostream( &buf) {}
+        : gzstreambase( name, mode), std::ostream( &buf) {}
     gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); }
     void open( const char* name, int open_mode = std::ios::out) {
-       gzstreambase::open( name, open_mode);
+        gzstreambase::open( name, open_mode);
     }
 };