src/stream/ZStrim_Tee.h

00001 /*  @(#) $Id: ZStrim_Tee.h,v 1.3 2006/04/10 20:44:22 agreen Exp $ */
00002 
00003 /* ------------------------------------------------------------
00004 Copyright (c) 2004 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 __ZStrim_Tee__
00026 #define __ZStrim_Tee__ 1
00027 #include "zconfig.h"
00028 
00029 #include "ZStrim.h"
00030 #include "ZStrimmer.h"
00031 
00032 // =================================================================================================
00033 #pragma mark -
00034 #pragma mark * ZStrimR_Tee
00035 
00037 
00038 class ZStrimR_Tee : public ZStrimR
00039         {
00040 public:
00041         ZStrimR_Tee(const ZStrimR& iSource, const ZStrimW& iSink);
00042 
00043 // From ZStrimR
00044         virtual void Imp_ReadUTF32(UTF32* iDest, size_t iCount, size_t* oCount);
00045 
00046 private:
00047         const ZStrimR& fSource;
00048         const ZStrimW& fSink;
00049         };
00050 
00051 // =================================================================================================
00052 #pragma mark -
00053 #pragma mark * ZStrimmerR_Tee
00054 
00056 
00057 class ZStrimmerR_Tee : public ZStrimmerR
00058         {
00059 public:
00060         ZStrimmerR_Tee(ZRef<ZStrimmerR> iStrimmerSource, ZRef<ZStrimmerW> iStrimmerSink);
00061         virtual ~ZStrimmerR_Tee();
00062 
00063 // From ZStrimmerR
00064         virtual const ZStrimR& GetStrimR();
00065 
00066 protected:
00067         ZRef<ZStrimmerR> fStrimmerSource;
00068         ZRef<ZStrimmerW> fStrimmerSink;
00069         ZStrimR_Tee fStrim;
00070         };
00071 
00072 // =================================================================================================
00073 #pragma mark -
00074 #pragma mark * ZStrimW_Tee
00075 
00077 
00078 class ZStrimW_Tee : public ZStrimW_NativeUTF32
00079         {
00080 public:
00081         ZStrimW_Tee(const ZStrimW& iSink1, const ZStrimW& iSink2);
00082 
00083 // From ZStrimW via ZStrimW_NativeUTF32
00084         virtual void Imp_WriteUTF32(const UTF32* iSource, size_t iCountCU, size_t* oCountCU);
00085         virtual void Imp_Flush();
00086 
00087 private:
00088         const ZStrimW& fSink1;
00089         const ZStrimW& fSink2;
00090         };
00091 
00092 // =================================================================================================
00093 #pragma mark -
00094 #pragma mark * ZStrimmerW_Tee
00095 
00097 
00098 class ZStrimmerW_Tee : public ZStrimmerW
00099         {
00100 public:
00101         ZStrimmerW_Tee(ZRef<ZStrimmerW> iStrimmerSink1, ZRef<ZStrimmerW> iStrimmerSink2);
00102         virtual ~ZStrimmerW_Tee();
00103 
00104 // From ZStrimmerW
00105         virtual const ZStrimW& GetStrimW();
00106 
00107 protected:
00108         ZRef<ZStrimmerW> fStrimmerSink1;
00109         ZRef<ZStrimmerW> fStrimmerSink2;
00110         ZStrimW_Tee fStrim;
00111         };
00112 
00113 #endif // __ZStrim_Tee__

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