src/stream/ZStream_Filter.h

00001 /*  @(#) $Id: ZStream_Filter.h,v 1.1 2006/10/13 22:14:51 agreen Exp $ */
00002 
00003 /* ------------------------------------------------------------
00004 Copyright (c) 2006 Andrew Green and Learning in Motion, Inc.
00005 http://www.zoolib.org
00006 
00007 Permission is hereby granted, free of charge, to any person obtaining a copy
00008 of this software and associated documentation files (the "Software"), to deal
00009 in the Software without restriction, including without limitation the rights
00010 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00011 copies of the Software, and to permit persons to whom the Software is
00012 furnished to do so, subject to the following conditions:
00013 
00014 The above copyright notice and this permission notice shall be included in
00015 all copies or substantial portions of the Software.
00016 
00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00020 COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00021 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00022 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023 ------------------------------------------------------------ */
00024 
00025 #ifndef __ZStream_Filter__
00026 #define __ZStream_Filter__ 1
00027 #include "zconfig.h"
00028 
00029 #include "ZStream.h"
00030 
00031 // =================================================================================================
00032 #pragma mark -
00033 #pragma mark * ZStreamR_Filter
00034 
00035 class ZStreamR_Filter : public ZStreamR
00036         {
00037 public:
00038         ZStreamR_Filter(const ZStreamR& iStreamReal);
00039 
00040         ~ZStreamR_Filter();
00041 
00042 // From ZStreamR
00043         virtual void Imp_Read(void* iDest, size_t iCount, size_t* oCountRead);
00044         virtual size_t Imp_CountReadable();
00045         virtual void Imp_Skip(uint64 iCount, uint64* oCountSkipped);
00046 
00047 protected:
00048         const ZStreamR& fStreamReal;
00049         };
00050 
00051 // =================================================================================================
00052 #pragma mark -
00053 #pragma mark * ZStreamU_Filter
00054 
00055 class ZStreamU_Filter : public ZStreamU
00056         {
00057 public:
00058         ZStreamU_Filter(const ZStreamU& iStreamReal);
00059 
00060         ~ZStreamU_Filter();
00061 
00062 // From ZStreamR via ZStreamU
00063         virtual void Imp_Read(void* iDest, size_t iCount, size_t* oCountRead);
00064         virtual size_t Imp_CountReadable();
00065         virtual void Imp_Skip(uint64 iCount, uint64* oCountSkipped);
00066 
00067 // from ZStreamU
00068         virtual void Imp_Unread();
00069 
00070 protected:
00071         const ZStreamU& fStreamReal;
00072         };
00073 
00074 // =================================================================================================
00075 #pragma mark -
00076 #pragma mark * ZStreamRPos_Filter
00077 
00078 class ZStreamRPos_Filter : public ZStreamRPos
00079         {
00080 public:
00081         ZStreamRPos_Filter(const ZStreamRPos& iStreamReal);
00082 
00083         ~ZStreamRPos_Filter();
00084 
00085 // From ZStreamR via ZStreamRPos
00086         virtual void Imp_Read(void* iDest, size_t iCount, size_t* oCountRead);
00087         virtual size_t Imp_CountReadable();
00088         virtual void Imp_Skip(uint64 iCount, uint64* oCountSkipped);
00089 
00090 // From ZStreamRPos
00091         virtual uint64 Imp_GetPosition();
00092         virtual void Imp_SetPosition(uint64 iPosition);
00093 
00094         virtual uint64 Imp_GetSize();
00095 
00096 protected:
00097         const ZStreamRPos& fStreamReal;
00098         };
00099 
00100 // =================================================================================================
00101 #pragma mark -
00102 #pragma mark * ZStreamW_Filter
00103 
00104 class ZStreamW_Filter : public ZStreamW
00105         {
00106 public:
00107         ZStreamW_Filter(const ZStreamW& iStreamReal);
00108 
00109         ~ZStreamW_Filter();
00110 
00111 // From ZStreamW
00112         virtual void Imp_Write(const void* iSource, size_t iCount, size_t* oCountWritten);
00113         virtual void Imp_Flush();
00114 
00115 protected:
00116         const ZStreamW& fStreamReal;
00117         };
00118 
00119 // =================================================================================================
00120 #pragma mark -
00121 #pragma mark * ZStreamWPos_Filter
00122 
00123 class ZStreamWPos_Filter : public ZStreamWPos
00124         {
00125 public:
00126         ZStreamWPos_Filter(const ZStreamWPos& iStreamReal);
00127 
00128         ~ZStreamWPos_Filter();
00129 
00130 // From ZStreamW via ZStreamRWPos
00131         virtual void Imp_Write(const void* iSource, size_t iCount, size_t* oCountWritten);
00132         virtual void Imp_Flush();
00133 
00134 // From ZStreamWPos
00135         virtual uint64 Imp_GetPosition();
00136         virtual void Imp_SetPosition(uint64 iPosition);
00137 
00138         virtual uint64 Imp_GetSize();
00139 
00140 // From ZStreamWPos via ZStreamRWPos
00141         virtual void Imp_SetSize(uint64 iSize);
00142 
00143 protected:
00144         const ZStreamWPos& fStreamReal;
00145         };
00146 
00147 // =================================================================================================
00148 #pragma mark -
00149 #pragma mark * ZStreamRWPos_Filter
00150 
00151 class ZStreamRWPos_Filter : public ZStreamRWPos
00152         {
00153 public:
00154         ZStreamRWPos_Filter(const ZStreamRWPos& iStreamReal);
00155 
00156         ~ZStreamRWPos_Filter();
00157 
00158 // From ZStreamR via ZStreamRWPos
00159         virtual void Imp_Read(void* iDest, size_t iCount, size_t* oCountRead);
00160         virtual size_t Imp_CountReadable();
00161         virtual void Imp_Skip(uint64 iCount, uint64* oCountSkipped);
00162 
00163 // From ZStreamW via ZStreamRWPos
00164         virtual void Imp_Write(const void* iSource, size_t iCount, size_t* oCountWritten);
00165         virtual void Imp_Flush();
00166 
00167 // From ZStreamRPos/ZStreamWPos via ZStreamRWPos
00168         virtual uint64 Imp_GetPosition();
00169         virtual void Imp_SetPosition(uint64 iPosition);
00170 
00171         virtual uint64 Imp_GetSize();
00172 
00173 // From ZStreamWPos via ZStreamRWPos
00174         virtual void Imp_SetSize(uint64 iSize);
00175 
00176 protected:
00177         const ZStreamRWPos& fStreamReal;
00178         };
00179 
00180 #endif // __ZStream_Filter__

Generated on Thu Jul 26 11:21:53 2007 for ZooLib by  doxygen 1.4.7