/usr/include/ossim/base/ossimGzStream.h is in libossim-dev 2.2.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | // ============================================================================
// gzstream, C++ iostream classes wrapping the zlib compression library.
// Copyright (C) 2001 Deepak Bandyopadhyay, Lutz Kettner
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// ============================================================================
//
// File : gzstream.h
// Revision : $Revision: 13050 $
// Revision_date : $Date: 2008-06-19 14:07:35 -0400 (Thu, 19 Jun 2008) $
// Author(s) : Deepak Bandyopadhyay, Lutz Kettner
//
// Standard streambuf implementation following Nicolai Josuttis, "The
// Standard C++ Library".
// ============================================================================
#ifndef ossimGzStream_HEADER
#define ossimGzStream_HEADER
// standard C++ with new header file names and std:: namespace
#include <ossim/base/ossimReferenced.h>
#include <ossim/base/ossimConstants.h>
#include <ossim/ossimConfig.h>
#include <iostream>
#include <fstream>
#include <ossim/base/ossimIoStream.h>
#if OSSIM_HAS_LIBZ
// ----------------------------------------------------------------------------
// Internal classes to implement gzstream. See below for user classes.
// ----------------------------------------------------------------------------
class OSSIM_DLL ossimGzStreamBuf : public std::streambuf
{
public:
ossimGzStreamBuf();
virtual ~ossimGzStreamBuf();
bool is_open()const;
ossimGzStreamBuf* open( const char* name, int open_mode);
ossimGzStreamBuf* close();
virtual int overflow( int c = EOF);
// will not use buffer for get.
virtual std::streamsize xsgetn(char_type* __s, std::streamsize n);
virtual int underflow();
virtual int sync();
virtual pos_type seekoff(off_type t, std::ios_base::seekdir dir,
std::ios_base::openmode omode = std::ios_base::in |
std::ios_base::out);
/* virtual pos_type seekpos(pos_type posType, */
/* std::ios_base::openmode __mode = std::ios_base::in | */
/* std::ios_base::out); */
private:
struct PrivateData;
int flush_buffer();
static const int bufferSize = 303; // 47+256 size of data buff
// totals 512 bytes under g++ for igzstream at the end.
PrivateData* prvtData;
char buffer[bufferSize]; // data buffer
bool opened; // open/close state of stream
int mode; // I/O mode
}; // End of class ossimGzStreamBuf
/* class OSSIM_DLL ossimGzStreamBase : virtual public ossimProtocolStream */
/* { */
/* protected: */
/* ossimGzStreamBuf buf; */
/* public: */
/* ossimGzStreamBase():ossimProtocolStream(&buf) { } */
/* ossimGzStreamBase( const char* name, int open_mode); */
/* virtual ~ossimGzStreamBase(); */
/* virtual void open( const char* name, int open_mode); */
/* virtual void close(); */
/* ossimGzStreamBuf* rdbuf() { return &buf; } */
/* TYPE_DATA */
/* }; */
//class OSSIM_DLL ossimIgzStream : public ossimGzStreamBase, public std::istream
class OSSIM_DLL ossimIgzStream : public ossimIFStream
{
public:
ossimIgzStream();
ossimIgzStream( const char* name,
std::ios_base::openmode mode = std::ios_base::in);
virtual ~ossimIgzStream();
ossimGzStreamBuf* rdbuf();
virtual void open( const char* name,
std::ios_base::openmode mode = std::ios_base::in);
virtual void close();
virtual bool is_open()const;
virtual bool isCompressed()const;
protected:
ossimGzStreamBuf buf;
}; // End of class ossimIgzStream
class OSSIM_DLL ossimOgzStream : public ossimOFStream
{
public:
ossimOgzStream();
ossimOgzStream( const char* name,
std::ios_base::openmode mode =
std::ios_base::out|std::ios_base::trunc );
virtual ~ossimOgzStream();
ossimGzStreamBuf* rdbuf();
void open( const char* name,
std::ios_base::openmode mode =
std::ios_base::out|std::ios_base::trunc );
virtual void close();
virtual bool is_open()const;
virtual bool isCompressed()const;
protected:
ossimGzStreamBuf buf;
}; // End of class ossimOgzStream
#endif /* #if OSSIM_HAS_LIBZ */
#endif /* #define ossimGzStream_HEADER */
|