source: box/trunk/lib/common/PartialReadStream.h @ 1586

Revision 1586, 1.2 KB checked in by chris, 5 years ago (diff)

Fix inability to handle streams over 2GB properly. (refs #3)

  • Property svn:eol-style set to native
Line 
1// --------------------------------------------------------------------------
2//
3// File
4//              Name:    PartialReadStream.h
5//              Purpose: Read part of another stream
6//              Created: 2003/08/26
7//
8// --------------------------------------------------------------------------
9
10#ifndef PARTIALREADSTREAM__H
11#define PARTIALREADSTREAM__H
12
13#include "IOStream.h"
14
15// --------------------------------------------------------------------------
16//
17// Class
18//              Name:    PartialReadStream
19//              Purpose: Read part of another stream
20//              Created: 2003/08/26
21//
22// --------------------------------------------------------------------------
23class PartialReadStream : public IOStream
24{
25public:
26        PartialReadStream(IOStream &rSource, pos_type BytesToRead);
27        ~PartialReadStream();
28private:
29        // no copying allowed
30        PartialReadStream(const IOStream &);
31        PartialReadStream(const PartialReadStream &);
32       
33public:
34        virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite);
35        virtual pos_type BytesLeftToRead();
36        virtual void Write(const void *pBuffer, int NBytes);
37        virtual bool StreamDataLeft();
38        virtual bool StreamClosed();
39
40private:
41        IOStream &mrSource;
42        pos_type mBytesLeft;
43};
44
45#endif // PARTIALREADSTREAM__H
46
Note: See TracBrowser for help on using the repository browser.