5 // Jackson Harper (Jackson@LatitudeGeo.com)
7 // (C) 2003 Jackson Harper, All rights reserved
13 namespace Mono.ILASM {
15 public class FieldDef {
18 private ITypeRef type;
19 private PEAPI.FieldAttr attr;
20 private PEAPI.FieldDef field_def;
22 private bool offset_set;
23 private bool datavalue_set;
24 private bool value_set;
28 public FieldDef (PEAPI.FieldAttr attr, string name,
36 datavalue_set = false;
44 public PEAPI.FieldDef FieldDef {
45 get { return field_def; }
48 public void SetOffset (uint val) {
54 /// Define a global field
56 public void Define (CodeGen code_gen)
58 type.Resolve (code_gen);
60 field_def = code_gen.PEFile.AddField (attr, name, type.PeapiType);
63 field_def.SetOffset (offset);
69 /// Define a field member of the specified class
71 public void Define (CodeGen code_gen, PEAPI.ClassDef class_def)
73 type.Resolve (code_gen);
75 class_def.AddField (attr, name, type.PeapiType);