-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPXBReader.h
executable file
·47 lines (33 loc) · 1.42 KB
/
PXBReader.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
//
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#ifndef PXBReaderH
#define PXBReaderH
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
class PXBReader {
private:
bool bFullRead;
char * sActualPosition;
FILE * pFile;
size_t szRemainingSize;
void ReadNextFilePart();
public:
enum enmDataTypes {
PXB_BYTE,
PXB_TWO_BYTES,
PXB_FOUR_BYTES,
PXB_STRING
};
void * pItemDatas[10];
uint16_t ui16ItemLengths[10];
char sItemIdentifiers[10][2];
uint8_t ui8ItemValues[10];
PXBReader();
~PXBReader();
bool OpenFileRead(const char * sFilename);
bool ReadNextItem(const uint16_t * sExpectedIdentificators, const uint8_t &ui8ExpectedSubItems, const uint8_t &ui8ExtraSubItems = 0);
bool OpenFileSave(const char * sFilename);
bool WriteNextItem(const uint32_t &ui32Length, const uint8_t &ui8SubItems);
void WriteRemaining();
};
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif