File: PartialReadStream.h

package info (click to toggle)
boxbackup 0.13~~git20221201.g166b3fa-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,172 kB
  • sloc: xml: 70,723; cpp: 55,456; ansic: 24,659; perl: 4,844; sh: 4,294; makefile: 588; python: 311
file content (47 lines) | stat: -rw-r--r-- 1,253 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// --------------------------------------------------------------------------
//
// File
//		Name:    PartialReadStream.h
//		Purpose: Read part of another stream
//		Created: 2003/08/26
//
// --------------------------------------------------------------------------

#ifndef PARTIALREADSTREAM__H
#define PARTIALREADSTREAM__H

#include "IOStream.h"

// --------------------------------------------------------------------------
//
// Class
//		Name:    PartialReadStream
//		Purpose: Read part of another stream
//		Created: 2003/08/26
//
// --------------------------------------------------------------------------
class PartialReadStream : public IOStream
{
public:
	PartialReadStream(IOStream &rSource, pos_type BytesToRead);
	~PartialReadStream();
private:
	// no copying allowed
	PartialReadStream(const IOStream &);
	PartialReadStream(const PartialReadStream &);
	
public:
	virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite);
	virtual pos_type BytesLeftToRead();
	virtual void Write(const void *pBuffer, int NBytes,
		int Timeout = IOStream::TimeOutInfinite);
	virtual bool StreamDataLeft();
	virtual bool StreamClosed();

private:
	IOStream &mrSource;
	pos_type mBytesLeft;
};

#endif // PARTIALREADSTREAM__H