00001 // -*- Mode: C++ -*- 00002 // GZIPInputStream.h 00003 // Copyright © 2003 Laboratoire de Biologie Informatique et Théorique 00004 // Université de Montréal. 00005 // Author : Martin Larose 00006 // Created On : Tue Nov 4 17:58:27 2003 00007 // $Revision: 1.1 $ 00008 // 00009 // This file is part of xmlcpg. 00010 // 00011 // xmlcpg is free software; you can redistribute it and/or modify it under 00012 // the terms of the GNU Lesser General Public License as published by the Free 00013 // Software Foundation; either version 2 of the License, or (at your option) 00014 // any later version. 00015 // 00016 // xmlcpg is distributed in the hope that it will be useful, but WITHOUT ANY 00017 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00018 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for 00019 // more details. 00020 // 00021 // You should have received a copy of the GNU Lesser General Public License 00022 // along with xmlcpg; if not, write to the Free Software Foundation, Inc., 00023 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 00025 00026 #ifndef _rnaml_GZIPInputStream_h_ 00027 #define _rnaml_GZIPInputStream_h_ 00028 00029 extern "C" { 00030 #include "gzipinputstream.h" 00031 #include "inputstream.h" 00032 } 00033 00034 #include "InputStream.h" 00035 00036 00037 00038 namespace rnaml 00039 { 00040 class FileInputStream; 00041 00042 00043 00048 class GZIPInputStream : public InputStream 00049 { 00053 xmlcpgGZIPInputStream *is; 00054 00055 public: 00056 00057 // LIFECYCLE ------------------------------------------------------------ 00058 00064 GZIPInputStream (FileInputStream *fis); 00065 00070 GZIPInputStream (int fd); 00071 00075 virtual ~GZIPInputStream (); 00076 00077 // OPERATORS ------------------------------------------------------------ 00078 00079 // ACCESS --------------------------------------------------------------- 00080 00085 virtual xmlcpgInputStream* getCStructure () const { return (xmlcpgInputStream*) is; } 00086 00091 virtual void setCStructure (xmlcpgInputStream *is); 00092 00093 // METHODS -------------------------------------------------------------- 00094 00099 virtual bool getEOS () const; 00100 00105 virtual bool getError () const; 00106 00111 virtual const char* getErrorString () const; 00112 00113 // I/O ----------------------------------------------------------------- 00114 00119 virtual int read (); 00120 00127 virtual int read (void *ptr, int nbytes); 00128 00133 virtual bool close (); 00134 00135 }; 00136 } 00137 00138 #endif