ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/gr2lib/trunk/gr2lib/core/coreclasses/header/granny_header.cs
(Generate patch)

Comparing trunk/gr2lib/core/coreclasses/header/granny_header.cs (file contents):
Revision 94 by william, Sat Jul 17 05:09:42 2010 UTC vs.
Revision 97 by william, Sat Jul 17 05:53:44 2010 UTC

# Line 1 | Line 1
1 < ´╗┐using System;
1 > ´╗┐//#define HAVE_GRN_REFERENCE // when defined enabled GRN_REFERNCE in Header, else it is disabled
2 > using System;
3   using System.Collections.Generic;
4   using System.Linq;
5   using System.Text;
# Line 23 | Line 24 | namespace gr2lib.core.coreclasses.header
24              this.CRC = 0;
25              this.SectionArrayOffset = 0;
26              this.SectionArrayCount = 0;
27 + #if HAVE_GRN_REFERENCE
28              this.RootObjectTypeDefinition = new granny_reference();
29              this.RootObject = new granny_reference();
30 + #endif
31              this.TypeTag = 0;
32              this.StringDatabaseCRC = 0;
33  
# Line 60 | Line 63 | namespace gr2lib.core.coreclasses.header
63                  managed.CRC = native.CRC;
64                  managed.SectionArrayOffset = native.SectionArrayOffset;
65                  managed.SectionArrayCount = native.SectionArrayCount;
66 <              
66 >
67                  // grn_reference
68  
69 + #if HAVE_GRN_REFERENCE
70                  if (native.RootObjectTypeDefinition != IntPtr.Zero)
71                  {
72                      //managed.RootObjectTypeDefinition = granny_reference.ReadFromMemory(native.RootObjectTypeDefinition);
73                      managed.RootObjectTypeDefinition = new granny_reference();
74                  }
71                else
72                {
73                    managed.RootObjectTypeDefinition = new granny_reference();
74                }
75                  if (native.RootObject != IntPtr.Zero)
76                  {
77                      //managed.RootObject = granny_reference.ReadFromMemory(native.RootObject);
78                      managed.RootObject = new granny_reference();
79                  }
80 <                else
81 <                {
82 <                    managed.RootObject = new granny_reference();
83 <                }
80 > #endif
81  
82                  //managed.TypeTag = native.TypeTag;
83                  managed.ExtraTags = native.ExtraTags;
# Line 109 | Line 106 | namespace gr2lib.core.coreclasses.header
106          private Int32 _CRC;
107          private Int32 _SectionArrayOffset;
108          private Int32 _SectionArrayCount;
109 + #if HAVE_GRN_REFERENCE
110          private granny_reference _RootObjectTypeDefinition;
111          private granny_reference _RootObject;
112 + #endif
113          private Int32 _TypeTag;
114          private Int32[] _ExtraTags; //4
115          private Int32 _StringDatabaseCRC;
# Line 122 | Line 121 | namespace gr2lib.core.coreclasses.header
121          public Int32 CRC { get { return _CRC; } set { _CRC = value; } }
122          public Int32 SectionArrayOffset { get { return _SectionArrayOffset; } set { _SectionArrayOffset = value; } }
123          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; } }
126          public granny_reference RootObject { get { return _RootObject; } set { _RootObject = value; } }
127 + #endif
128          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
130          public Int32 StringDatabaseCRC { get { return _StringDatabaseCRC; } set { _StringDatabaseCRC = value; } }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines