Vault
4.1
|
00001 /* 00002 Copyright c1997-2014 Trygve Isaacson. All rights reserved. 00003 This file is part of the Code Vault version 4.1 00004 http://www.bombaydigital.com/ 00005 License: MIT. See LICENSE.md in the Vault top level directory. 00006 */ 00007 00008 #ifndef vwritebufferedstream_h 00009 #define vwritebufferedstream_h 00010 00013 #include "vmemorystream.h" 00014 00039 class VWriteBufferedStream : public VMemoryStream { 00040 public: 00041 00045 VWriteBufferedStream(VStream& rawStream, Vs64 initialBufferSize = VMemoryStream::kDefaultBufferSize, Vs64 resizeIncrement = VMemoryStream::kIncrement2x); 00049 virtual ~VWriteBufferedStream() {} 00050 00057 virtual Vs64 read(Vu8* targetBuffer, Vs64 numBytesToRead); 00058 00063 virtual void flush(); 00064 00069 virtual bool skip(Vs64 numBytesToSkip); 00070 00071 // FIXME: need to define the semantics of tell() and seek() for 00072 // this subclass. For the moment, we'll do like seek/skip and 00073 // call through to the raw stream, though I'm not sure it should 00074 // really be like that. 00075 00076 private: 00077 00078 // Prevent copy construction and assignment since there is no provision for sharing the raw stream. 00079 VWriteBufferedStream(const VWriteBufferedStream& other); 00080 VWriteBufferedStream& operator=(const VWriteBufferedStream& other); 00081 00082 VStream& mRawStream; 00083 }; 00084 00085 #endif /* vwritebufferedstream_h */