Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

/home/jeroen/FOX/fox/fox-1.7.33/include/FXGZFileStream.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                     G Z F i l e S t r e a m   C l a s s e s                   *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2002,2012 by Sander Jansen.   All Rights Reserved.              *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifdef HAVE_ZLIB_H
00022 #ifndef FXGZFILESTREAM_H
00023 #define FXGZFILESTREAM_H
00024 
00025 #ifndef FXFILESTREAM_H
00026 #include "FXFileStream.h"
00027 #endif
00028 
00029 
00030 namespace FX {
00031 
00032 
00033 struct ZBlock;
00034 
00035 
00037 class FXAPI FXGZFileStream : public FXFileStream {
00038 private:
00039   ZBlock *gz;
00040   int     ac;
00041 protected:
00042   virtual FXuval writeBuffer(FXuval count);
00043   virtual FXuval readBuffer(FXuval count);
00044 public:
00045 
00047   FXGZFileStream(const FXObject* cont=NULL);
00048 
00050   FXGZFileStream(const FXString& filename,FXStreamDirection save_or_load=FXStreamLoad,FXuval size=8192UL);
00051 
00053   FXbool open(const FXString& filename,FXStreamDirection save_or_load=FXStreamLoad,FXuval size=8192UL);
00054 
00056   virtual FXbool flush();
00057 
00059   virtual FXbool close();
00060 
00062   FXlong position() const { return FXStream::position(); }
00063 
00065   virtual FXbool position(FXlong,FXWhence){ return false; }
00066 
00068   FXGZFileStream& operator<<(const FXuchar& v){ FXStream::operator<<(v); return *this; }
00069   FXGZFileStream& operator<<(const FXchar& v){ FXStream::operator<<(v); return *this; }
00070   FXGZFileStream& operator<<(const FXbool& v){ FXStream::operator<<(v); return *this; }
00071   FXGZFileStream& operator<<(const FXushort& v){ FXStream::operator<<(v); return *this; }
00072   FXGZFileStream& operator<<(const FXshort& v){ FXStream::operator<<(v); return *this; }
00073   FXGZFileStream& operator<<(const FXuint& v){ FXStream::operator<<(v); return *this; }
00074   FXGZFileStream& operator<<(const FXint& v){ FXStream::operator<<(v); return *this; }
00075   FXGZFileStream& operator<<(const FXfloat& v){ FXStream::operator<<(v); return *this; }
00076   FXGZFileStream& operator<<(const FXdouble& v){ FXStream::operator<<(v); return *this; }
00077   FXGZFileStream& operator<<(const FXlong& v){ FXStream::operator<<(v); return *this; }
00078   FXGZFileStream& operator<<(const FXulong& v){ FXStream::operator<<(v); return *this; }
00079 
00081   FXGZFileStream& save(const FXuchar* p,FXuval n){ FXStream::save(p,n); return *this; }
00082   FXGZFileStream& save(const FXchar* p,FXuval n){ FXStream::save(p,n); return *this; }
00083   FXGZFileStream& save(const FXbool* p,FXuval n){ FXStream::save(p,n); return *this; }
00084   FXGZFileStream& save(const FXushort* p,FXuval n){ FXStream::save(p,n); return *this; }
00085   FXGZFileStream& save(const FXshort* p,FXuval n){ FXStream::save(p,n); return *this; }
00086   FXGZFileStream& save(const FXuint* p,FXuval n){ FXStream::save(p,n); return *this; }
00087   FXGZFileStream& save(const FXint* p,FXuval n){ FXStream::save(p,n); return *this; }
00088   FXGZFileStream& save(const FXfloat* p,FXuval n){ FXStream::save(p,n); return *this; }
00089   FXGZFileStream& save(const FXdouble* p,FXuval n){ FXStream::save(p,n); return *this; }
00090   FXGZFileStream& save(const FXlong* p,FXuval n){ FXStream::save(p,n); return *this; }
00091   FXGZFileStream& save(const FXulong* p,FXuval n){ FXStream::save(p,n); return *this; }
00092 
00094   FXGZFileStream& operator>>(FXuchar& v){ FXStream::operator>>(v); return *this; }
00095   FXGZFileStream& operator>>(FXchar& v){ FXStream::operator>>(v); return *this; }
00096   FXGZFileStream& operator>>(FXbool& v){ FXStream::operator>>(v); return *this; }
00097   FXGZFileStream& operator>>(FXushort& v){ FXStream::operator>>(v); return *this; }
00098   FXGZFileStream& operator>>(FXshort& v){ FXStream::operator>>(v); return *this; }
00099   FXGZFileStream& operator>>(FXuint& v){ FXStream::operator>>(v); return *this; }
00100   FXGZFileStream& operator>>(FXint& v){ FXStream::operator>>(v); return *this; }
00101   FXGZFileStream& operator>>(FXfloat& v){ FXStream::operator>>(v); return *this; }
00102   FXGZFileStream& operator>>(FXdouble& v){ FXStream::operator>>(v); return *this; }
00103   FXGZFileStream& operator>>(FXlong& v){ FXStream::operator>>(v); return *this; }
00104   FXGZFileStream& operator>>(FXulong& v){ FXStream::operator>>(v); return *this; }
00105 
00107   FXGZFileStream& load(FXuchar* p,FXuval n){ FXStream::load(p,n); return *this; }
00108   FXGZFileStream& load(FXchar* p,FXuval n){ FXStream::load(p,n); return *this; }
00109   FXGZFileStream& load(FXbool* p,FXuval n){ FXStream::load(p,n); return *this; }
00110   FXGZFileStream& load(FXushort* p,FXuval n){ FXStream::load(p,n); return *this; }
00111   FXGZFileStream& load(FXshort* p,FXuval n){ FXStream::load(p,n); return *this; }
00112   FXGZFileStream& load(FXuint* p,FXuval n){ FXStream::load(p,n); return *this; }
00113   FXGZFileStream& load(FXint* p,FXuval n){ FXStream::load(p,n); return *this; }
00114   FXGZFileStream& load(FXfloat* p,FXuval n){ FXStream::load(p,n); return *this; }
00115   FXGZFileStream& load(FXdouble* p,FXuval n){ FXStream::load(p,n); return *this; }
00116   FXGZFileStream& load(FXlong* p,FXuval n){ FXStream::load(p,n); return *this; }
00117   FXGZFileStream& load(FXulong* p,FXuval n){ FXStream::load(p,n); return *this; }
00118 
00120   FXGZFileStream& saveObject(const FXObject* v){ FXStream::saveObject(v); return *this; }
00121 
00123   FXGZFileStream& loadObject(FXObject*& v){ FXStream::loadObject(v); return *this; }
00124 
00126   virtual ~FXGZFileStream();
00127   };
00128 
00129 }
00130 
00131 
00132 #endif
00133 #endif

Copyright © 1997-2011 Jeroen van der Zijp