-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstruct.h
61 lines (52 loc) · 1.4 KB
/
struct.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
#pragma once
#ifndef _STRUCT_H_
#define _STRUCT_H_
class VarInfo
{
public:
void Init(wxString name = wxEmptyString)
{
this->name = name;
bSigned = true;
type = 0; // int
size = 0;
count = 0;
base = 0;
pointerType = PT_NONE;
IsArray = false;
pointerBase = 0;
offset = 0;
}
wxString name;
bool bSigned;
int type; // 0 = int, 1 = float
int size; // 1 - 8
bool IsArray;
int count; // for arrays
int base; // 0 = default
int pointerType; // is this member a pointer to somewhere in this file?
enum {PT_NONE, PT_RELATIVE, PT_ABSOLUTE};
THSIZE pointerBase;
int offset; // offset of this member in structure
wxString Format(const void *pStart);
wxString FormatItem(const void *pStart);
THSIZE GetSize() { return (count || IsArray) ? (THSIZE)size * count : size; }
//! need something better for char[0] types
wxString FormatType();
THSIZE GetPointer(HexWnd *hw, THSIZE base);
};
class StructInfo
{
public:
wxString name;
std::vector<VarInfo> vars;
THSIZE m_tmpOffset;
bool HasVar(wxString name);
void Init(wxString name = wxEmptyString);
void Add(VarInfo &var);
THSIZE GetSize();
};
class yyFlexLexer;
#define YYPARSE_PARAM dummy, yyFlexLexer *flex, std::vector<StructInfo> *pStructVec
extern int yyparse(void *YYPARSE_PARAM);
#endif //_STRUCT_H_