1 /*
2  * HLLib
3  * Copyright (C) 2006-2010 Ryan Gregg
4 
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later
9  * version.
10  */
11 
12 #ifndef STREAM_H
13 #define STREAM_H
14 
15 #include "stdafx.h"
16 
17 namespace HLLib
18 {
19 	namespace Streams
20 	{
21 		class HLLIB_API IStream
22 		{
23 		public:
24 			virtual ~IStream();
25 
26 			virtual HLStreamType GetType() const = 0;
27 
28 			virtual const hlChar *GetFileName() const = 0;
29 
30 			virtual hlBool GetOpened() const = 0;
31 			virtual hlUInt GetMode() const = 0;
32 
33 			virtual hlBool Open(hlUInt uiMode) = 0;
34 			virtual hlVoid Close() = 0;
35 
36 			virtual hlULongLong GetStreamSize() const = 0;
37 			virtual hlULongLong GetStreamPointer() const = 0;
38 
39 			virtual hlULongLong Seek(hlLongLong iOffset, HLSeekMode eSeekMode) = 0;
40 
41 			virtual hlBool Read(hlChar &cChar) = 0;
42 			virtual hlUInt Read(hlVoid *lpData, hlUInt uiBytes) = 0;
43 
44 			virtual hlBool Write(hlChar cChar) = 0;
45 			virtual hlUInt Write(const hlVoid *lpData, hlUInt uiBytes) = 0;
46 		};
47 	}
48 }
49 
50 #endif
51