00001 /* Copyright (c) 2006, Gennady Bystritsky <bystr@mac.com> 00002 * 00003 * Distributed under the MIT Licence. 00004 * This is free software. See 'LICENSE' for details. 00005 * You must read and accept the license prior to use. 00006 */ 00007 00008 #ifndef _SK_IO_DELEGATINGOUTPUTSTREAM_ 00009 #define _SK_IO_DELEGATINGOUTPUTSTREAM_ 00010 00011 #include <sk/io/AbstractOutputStream.h> 00012 00013 namespace sk { 00014 namespace io { 00015 class DelegatingOutputStream 00016 : public virtual sk::io::AbstractOutputStream 00017 { 00018 public: 00019 DelegatingOutputStream(sk::io::OutputStream& stream); 00020 virtual ~DelegatingOutputStream(); 00021 00022 sk::io::OutputStream& getOutputStream() const; 00023 00024 // sk::util::Object re-implementation. 00025 const sk::util::Class getClass() const; 00026 00027 // sk::io::OutputSteam implementation. 00028 void close(); 00029 void flush(); 00030 int write(const char* buffer, int offset, int length); 00031 using AbstractOutputStream::write; 00032 00033 private: 00034 DelegatingOutputStream(const DelegatingOutputStream& other); 00035 DelegatingOutputStream& operator = (const DelegatingOutputStream& other); 00036 00037 sk::io::OutputStream& _stream; 00038 }; 00039 } 00040 } 00041 00042 #endif /* _SK_IO_DELEGATINGOUTPUTSTREAM_ */