-
Notifications
You must be signed in to change notification settings - Fork 16
/
BinReader.h
51 lines (38 loc) · 764 Bytes
/
BinReader.h
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
48
49
50
51
// 120111
// 120112
// 120806
#ifndef __BinReader_h__
#define __BinReader_h__
#include <string>
#include "FileMapping.h"
class BinReader
{
public:
BinReader(FileMapping & fm);
char ReadInt8();
short ReadInt16();
int ReadInt32();
int64 ReadInt64();
unsigned char ReadUInt8();
unsigned short ReadUInt16();
unsigned int ReadUInt32();
uint64 ReadUInt64();
float ReadSingle();
double ReadDouble();
void ReadWstring(std::wstring & str);
void ReadAstring(std::string & str);
bool IsEOF() const;
uint64 GetPosition() const;
void SetPosition(uint64 ptr);
void Reset();
FileMapping & GetFileMapping() const;
private:
FileMapping &m_FileMapping;
uint64 m_Pointer;
bool m_bError;
#ifdef _DEBUG
public:
size_t m_ReadCount;
#endif
};
#endif