summaryrefslogtreecommitdiffstats
path: root/hostTools/lzma/compress/IInOutStreams.h
blob: c0842172f2db19d2a54d2064a96cfc27f4cfe151 (plain)
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
#ifndef __IINOUTSTREAMS_H
#define __IINOUTSTREAMS_H

#include "Portable.h"

class ISequentialInStream
{
	const char* data;
	unsigned size;
public:
	ISequentialInStream(const char* Adata, unsigned Asize) : data(Adata), size(Asize) { }

	HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize);
};

class ISequentialOutStream
{
	char* data;
	unsigned size;
	bool overflow;
	unsigned total;
public:
	ISequentialOutStream(char* Adata, unsigned Asize) : data(Adata), size(Asize), overflow(false), total(0) { }

	bool overflow_get() const { return overflow; }
	unsigned size_get() const { return total; }

	HRESULT Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize);
};

#endif