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

Comparing trunk/gr2lib/core/coreclasses/header/granny_file.cs (file contents):
Revision 94 by william, Sat Jul 17 05:09:42 2010 UTC vs.
Revision 102 by william, Sat Jul 17 13:54:18 2010 UTC

# Line 46 | Line 46 | namespace gr2lib.core.header
46              coreapi.FreeFile(NativeFilePointer);
47          }
48  
49
50        //internal static granny_file ReadFromMemory(IntPtr pointer)
51        //{
52        //    if (pointer == IntPtr.Zero) return null;
53        //    gr2lib.core.coretypes.native.granny_file native = Helpers.ReadFromMemory<gr2lib.core.coretypes.native.granny_file>(pointer);
54        //    granny_file managed = new granny_file();
55        //    managed.NativePointer = pointer;
56
57        //    // process
58          
59
60        //    return managed;
61        //}
49          internal static void ReadFromMemory(string filename, ref granny_file grn_file)
50          {
51              //if (grn_file.NativePointer == IntPtr.Zero) return;
# Line 68 | Line 55 | namespace gr2lib.core.header
55  
56              // process
57  
58 +            
59              managed.IsByteReversed = native.IsByteReversed;
60              managed.SectionCount = native.SectionCount;
61              managed.Sections = native.Sections;
# Line 101 | Line 89 | namespace gr2lib.core.header
89              grn_file = managed;
90          }
91  
92 <        //public static void ReadFromFile(string filename, out granny_file grn_file)
105 <        //{
106 <        //    grn_file = new granny_file();
107 <        //    grn_file.NativePointer = coreapi.GrannyReadEntireFile(filename);
108 <        //    if (grn_file.NativePointer == null || grn_file.NativePointer == IntPtr.Zero)
109 <        //    {
110 <        //        Console.WriteLine("Error: unable to load {0} as a Granny file.", filename);
111 <        //    }
112 <
113 <        //    grn_file.NativeFilePointer = coreapi.GetFileInfo(grn_file.NativePointer);
114 <        //    ReadFromMemory(out grn_file);
115 <        //    coreapi.FreeFile(grn_file.NativePointer);
116 <        //}
92 >
93  
94          public static granny_file ReadFromFile(string filename)
95          {
# Line 159 | Line 135 | namespace gr2lib.core.header
135          public bool Marshalled { get { return _Marshalled; } set { _Marshalled = value; } }
136          public bool IsUserMemory { get { return _IsUserMemory; } set { _IsUserMemory = value; } }
137          public IntPtr ConversionBuffer { get { return _ConversionBuffer; } set { _ConversionBuffer = value; } }
138 +
139 +
140 +        public bool HaveHeader { get { if (Header == null) return false; return true; } }
141 +        public bool HaveMagic { get { if (SourceMagicValue == null) return false; return true; } }
142          #endregion
143      }
144   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines