/[gr2lib]/trunk/gr2lib/core/coreclasses/header/granny_header.cs
ViewVC logotype

Diff of /trunk/gr2lib/core/coreclasses/header/granny_header.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 94 by william, Sat Jul 17 05:09:42 2010 UTC revision 97 by william, Sat Jul 17 05:53:44 2010 UTC
# Line 1  Line 1 
1  ´╗┐using System;  ´╗┐//#define HAVE_GRN_REFERENCE // when defined enabled GRN_REFERNCE in Header, else it is disabled
2    using System;
3  using System.Collections.Generic;  using System.Collections.Generic;
4  using System.Linq;  using System.Linq;
5  using System.Text;  using System.Text;
# Line 23  namespace gr2lib.core.coreclasses.header Line 24  namespace gr2lib.core.coreclasses.header
24              this.CRC = 0;              this.CRC = 0;
25              this.SectionArrayOffset = 0;              this.SectionArrayOffset = 0;
26              this.SectionArrayCount = 0;              this.SectionArrayCount = 0;
27    #if HAVE_GRN_REFERENCE
28              this.RootObjectTypeDefinition = new granny_reference();              this.RootObjectTypeDefinition = new granny_reference();
29              this.RootObject = new granny_reference();              this.RootObject = new granny_reference();
30    #endif
31              this.TypeTag = 0;              this.TypeTag = 0;
32              this.StringDatabaseCRC = 0;              this.StringDatabaseCRC = 0;
33    
# Line 60  namespace gr2lib.core.coreclasses.header Line 63  namespace gr2lib.core.coreclasses.header
63                  managed.CRC = native.CRC;                  managed.CRC = native.CRC;
64                  managed.SectionArrayOffset = native.SectionArrayOffset;                  managed.SectionArrayOffset = native.SectionArrayOffset;
65                  managed.SectionArrayCount = native.SectionArrayCount;                  managed.SectionArrayCount = native.SectionArrayCount;
66                  
67                  // grn_reference                  // grn_reference
68    
69    #if HAVE_GRN_REFERENCE
70                  if (native.RootObjectTypeDefinition != IntPtr.Zero)                  if (native.RootObjectTypeDefinition != IntPtr.Zero)
71                  {                  {
72                      //managed.RootObjectTypeDefinition = granny_reference.ReadFromMemory(native.RootObjectTypeDefinition);                      //managed.RootObjectTypeDefinition = granny_reference.ReadFromMemory(native.RootObjectTypeDefinition);
73                      managed.RootObjectTypeDefinition = new granny_reference();                      managed.RootObjectTypeDefinition = new granny_reference();
74                  }                  }
                 else  
                 {  
                     managed.RootObjectTypeDefinition = new granny_reference();  
                 }  
75                  if (native.RootObject != IntPtr.Zero)                  if (native.RootObject != IntPtr.Zero)
76                  {                  {
77                      //managed.RootObject = granny_reference.ReadFromMemory(native.RootObject);                      //managed.RootObject = granny_reference.ReadFromMemory(native.RootObject);
78                      managed.RootObject = new granny_reference();                      managed.RootObject = new granny_reference();
79                  }                  }
80                  else  #endif
                 {  
                     managed.RootObject = new granny_reference();  
                 }  
81    
82                  //managed.TypeTag = native.TypeTag;                  //managed.TypeTag = native.TypeTag;
83                  managed.ExtraTags = native.ExtraTags;                  managed.ExtraTags = native.ExtraTags;
# Line 109  namespace gr2lib.core.coreclasses.header Line 106  namespace gr2lib.core.coreclasses.header
106          private Int32 _CRC;          private Int32 _CRC;
107          private Int32 _SectionArrayOffset;          private Int32 _SectionArrayOffset;
108          private Int32 _SectionArrayCount;          private Int32 _SectionArrayCount;
109    #if HAVE_GRN_REFERENCE
110          private granny_reference _RootObjectTypeDefinition;          private granny_reference _RootObjectTypeDefinition;
111          private granny_reference _RootObject;          private granny_reference _RootObject;
112    #endif
113          private Int32 _TypeTag;          private Int32 _TypeTag;
114          private Int32[] _ExtraTags; //4          private Int32[] _ExtraTags; //4
115          private Int32 _StringDatabaseCRC;          private Int32 _StringDatabaseCRC;
# Line 122  namespace gr2lib.core.coreclasses.header Line 121  namespace gr2lib.core.coreclasses.header
121          public Int32 CRC { get { return _CRC; } set { _CRC = value; } }          public Int32 CRC { get { return _CRC; } set { _CRC = value; } }
122          public Int32 SectionArrayOffset { get { return _SectionArrayOffset; } set { _SectionArrayOffset = value; } }          public Int32 SectionArrayOffset { get { return _SectionArrayOffset; } set { _SectionArrayOffset = value; } }
123          public Int32 SectionArrayCount { get { return _SectionArrayCount; } set { _SectionArrayCount = value; } }          public Int32 SectionArrayCount { get { return _SectionArrayCount; } set { _SectionArrayCount = value; } }
124    #if HAVE_GRN_REFERENCE
125          public granny_reference RootObjectTypeDefinition { get { return _RootObjectTypeDefinition; } set { _RootObjectTypeDefinition = value; } }          public granny_reference RootObjectTypeDefinition { get { return _RootObjectTypeDefinition; } set { _RootObjectTypeDefinition = value; } }
126          public granny_reference RootObject { get { return _RootObject; } set { _RootObject = value; } }          public granny_reference RootObject { get { return _RootObject; } set { _RootObject = value; } }
127    #endif
128          public Int32 TypeTag { get { return _TypeTag; } set { _TypeTag = value; } }          public Int32 TypeTag { get { return _TypeTag; } set { _TypeTag = value; } }
129          public Int32[] ExtraTags { get { return _ExtraTags; } set { if (value.Length > GrannyGRNExtraTagCount) throw new InvalidOperationException("The size of ExtraTags cannot be greater than " + GrannyGRNExtraTagCount); _ExtraTags = value; } } //4          public Int32[] ExtraTags { get { return _ExtraTags; } set { if (value.Length > GrannyGRNExtraTagCount) throw new InvalidOperationException("The size of ExtraTags cannot be greater than " + GrannyGRNExtraTagCount); _ExtraTags = value; } } //4
130          public Int32 StringDatabaseCRC { get { return _StringDatabaseCRC; } set { _StringDatabaseCRC = value; } }          public Int32 StringDatabaseCRC { get { return _StringDatabaseCRC; } set { _StringDatabaseCRC = value; } }

Legend:
Removed from v.94  
changed lines
  Added in v.97

  ViewVC Help
Powered by ViewVC 1.1.22