-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathItem.h
75 lines (65 loc) · 1.46 KB
/
Item.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// item.h: interface for the Citem class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_ITEM_H__F0B0122C_EF02_46C7_B3F4_3B5A7BC68CC0__INCLUDED_)
#define AFX_ITEM_H__F0B0122C_EF02_46C7_B3F4_3B5A7BC68CC0__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "structs.h"
#define REV_BG 1
#define REV_PST 11
#define REV_IWD2 20
class Citem
{
private:
int fhandle;
int startpoint;
int maxlen;
public:
int revision;
item_header header;
iwd2_header iwd2header;
pst_header pstheader;
int extheadcount;
int featblkcount;
ext_header *extheaders;
feat_block *featblocks;
bool m_changed;
Citem();
virtual ~Citem();
int adjust_actpoint(long offset);
inline long myseek(long pos)
{
return lseek(fhandle, pos+startpoint,SEEK_SET)-startpoint;
}
inline long actpoint()
{
return tell(fhandle)-startpoint;
}
int ReadItemFromFile(int fh, long ml);
CString RetrieveResourceRef(int fh);
long RetrieveNameRef(int fh);
int RetrieveItemType(int fh);
int WriteItemToFile(int fhandle, int calculate=0);
inline void KillExtHeaders()
{
if(extheaders)
{
delete[] extheaders;
extheaders=NULL;
extheadcount=0;
}
}
inline void KillFeatHeaders()
{
if(featblocks)
{
delete[] featblocks;
featblocks=NULL;
featblkcount=0;
}
}
private:
};
#endif // !defined(AFX_ITEM_H__F0B0122C_EF02_46C7_B3F4_3B5A7BC68CC0__INCLUDED_)