fix typo
[mcs.git] / class / Mono.Cecil / Mono.Cecil.Metadata / MetadataRowWriter.cs
blobc592cc3d200d83cbb99898007a1dfc04cc2d61fc
1 //
2 // MetadataRowWriter.cs
3 //
4 // Author:
5 // Jb Evain (jbevain@gmail.com)
6 //
7 // Generated by /CodeGen/cecil-gen.rb do not edit
8 // Sat Feb 16 23:24:17 +0100 2008
9 //
10 // (C) 2005 Jb Evain
12 // Permission is hereby granted, free of charge, to any person obtaining
13 // a copy of this software and associated documentation files (the
14 // "Software"), to deal in the Software without restriction, including
15 // without limitation the rights to use, copy, modify, merge, publish,
16 // distribute, sublicense, and/or sell copies of the Software, and to
17 // permit persons to whom the Software is furnished to do so, subject to
18 // the following conditions:
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 namespace Mono.Cecil.Metadata {
34 using System;
35 using System.Collections;
37 using Mono.Cecil.Binary;
39 sealed class MetadataRowWriter : BaseMetadataRowVisitor {
41 MetadataRoot m_root;
42 MemoryBinaryWriter m_binaryWriter;
44 Utilities.TableRowCounter m_counter;
45 int [] m_ciCache;
47 int m_blobHeapIdxSz;
48 int m_stringsHeapIdxSz;
49 int m_guidHeapIdxSz;
51 public MetadataRowWriter (MetadataTableWriter mtwv)
53 m_binaryWriter = mtwv.GetWriter ();
54 m_root = mtwv.GetMetadataRoot ();
55 m_ciCache = new int [13];
56 m_counter = new Utilities.TableRowCounter (GetNumberOfRows);
59 void WriteBlobPointer (uint pointer)
61 WriteByIndexSize (pointer, m_blobHeapIdxSz);
64 void WriteStringPointer (uint pointer)
66 WriteByIndexSize (pointer, m_stringsHeapIdxSz);
69 void WriteGuidPointer (uint pointer)
71 WriteByIndexSize (pointer, m_guidHeapIdxSz);
74 void WriteTablePointer (uint pointer, int rid)
76 WriteByIndexSize (pointer, GetNumberOfRows (rid) < (1 << 16) ? 2 : 4);
79 void WriteMetadataToken (MetadataToken token, CodedIndex ci)
81 WriteByIndexSize (Utilities.CompressMetadataToken (ci, token),
82 Utilities.GetCodedIndexSize (ci, m_counter, m_ciCache));
85 int GetNumberOfRows (int rid)
87 IMetadataTable t = m_root.Streams.TablesHeap [rid];
88 if (t == null || t.Rows == null)
89 return 0;
90 return t.Rows.Count;
93 void WriteByIndexSize (uint value, int size)
95 if (size == 4)
96 m_binaryWriter.Write (value);
97 else if (size == 2)
98 m_binaryWriter.Write ((ushort) value);
99 else
100 throw new MetadataFormatException ("Non valid size for indexing");
103 public AssemblyRow CreateAssemblyRow (AssemblyHashAlgorithm _hashAlgId, ushort _majorVersion, ushort _minorVersion, ushort _buildNumber, ushort _revisionNumber, AssemblyFlags _flags, uint _publicKey, uint _name, uint _culture)
105 AssemblyRow row = new AssemblyRow ();
106 row.HashAlgId = _hashAlgId;
107 row.MajorVersion = _majorVersion;
108 row.MinorVersion = _minorVersion;
109 row.BuildNumber = _buildNumber;
110 row.RevisionNumber = _revisionNumber;
111 row.Flags = _flags;
112 row.PublicKey = _publicKey;
113 row.Name = _name;
114 row.Culture = _culture;
115 return row;
118 public AssemblyOSRow CreateAssemblyOSRow (uint _oSPlatformID, uint _oSMajorVersion, uint _oSMinorVersion)
120 AssemblyOSRow row = new AssemblyOSRow ();
121 row.OSPlatformID = _oSPlatformID;
122 row.OSMajorVersion = _oSMajorVersion;
123 row.OSMinorVersion = _oSMinorVersion;
124 return row;
127 public AssemblyProcessorRow CreateAssemblyProcessorRow (uint _processor)
129 AssemblyProcessorRow row = new AssemblyProcessorRow ();
130 row.Processor = _processor;
131 return row;
134 public AssemblyRefRow CreateAssemblyRefRow (ushort _majorVersion, ushort _minorVersion, ushort _buildNumber, ushort _revisionNumber, AssemblyFlags _flags, uint _publicKeyOrToken, uint _name, uint _culture, uint _hashValue)
136 AssemblyRefRow row = new AssemblyRefRow ();
137 row.MajorVersion = _majorVersion;
138 row.MinorVersion = _minorVersion;
139 row.BuildNumber = _buildNumber;
140 row.RevisionNumber = _revisionNumber;
141 row.Flags = _flags;
142 row.PublicKeyOrToken = _publicKeyOrToken;
143 row.Name = _name;
144 row.Culture = _culture;
145 row.HashValue = _hashValue;
146 return row;
149 public AssemblyRefOSRow CreateAssemblyRefOSRow (uint _oSPlatformID, uint _oSMajorVersion, uint _oSMinorVersion, uint _assemblyRef)
151 AssemblyRefOSRow row = new AssemblyRefOSRow ();
152 row.OSPlatformID = _oSPlatformID;
153 row.OSMajorVersion = _oSMajorVersion;
154 row.OSMinorVersion = _oSMinorVersion;
155 row.AssemblyRef = _assemblyRef;
156 return row;
159 public AssemblyRefProcessorRow CreateAssemblyRefProcessorRow (uint _processor, uint _assemblyRef)
161 AssemblyRefProcessorRow row = new AssemblyRefProcessorRow ();
162 row.Processor = _processor;
163 row.AssemblyRef = _assemblyRef;
164 return row;
167 public ClassLayoutRow CreateClassLayoutRow (ushort _packingSize, uint _classSize, uint _parent)
169 ClassLayoutRow row = new ClassLayoutRow ();
170 row.PackingSize = _packingSize;
171 row.ClassSize = _classSize;
172 row.Parent = _parent;
173 return row;
176 public ConstantRow CreateConstantRow (ElementType _type, MetadataToken _parent, uint _value)
178 ConstantRow row = new ConstantRow ();
179 row.Type = _type;
180 row.Parent = _parent;
181 row.Value = _value;
182 return row;
185 public CustomAttributeRow CreateCustomAttributeRow (MetadataToken _parent, MetadataToken _type, uint _value)
187 CustomAttributeRow row = new CustomAttributeRow ();
188 row.Parent = _parent;
189 row.Type = _type;
190 row.Value = _value;
191 return row;
194 public DeclSecurityRow CreateDeclSecurityRow (SecurityAction _action, MetadataToken _parent, uint _permissionSet)
196 DeclSecurityRow row = new DeclSecurityRow ();
197 row.Action = _action;
198 row.Parent = _parent;
199 row.PermissionSet = _permissionSet;
200 return row;
203 public EventRow CreateEventRow (EventAttributes _eventFlags, uint _name, MetadataToken _eventType)
205 EventRow row = new EventRow ();
206 row.EventFlags = _eventFlags;
207 row.Name = _name;
208 row.EventType = _eventType;
209 return row;
212 public EventMapRow CreateEventMapRow (uint _parent, uint _eventList)
214 EventMapRow row = new EventMapRow ();
215 row.Parent = _parent;
216 row.EventList = _eventList;
217 return row;
220 public EventPtrRow CreateEventPtrRow (uint _event)
222 EventPtrRow row = new EventPtrRow ();
223 row.Event = _event;
224 return row;
227 public ExportedTypeRow CreateExportedTypeRow (TypeAttributes _flags, uint _typeDefId, uint _typeName, uint _typeNamespace, MetadataToken _implementation)
229 ExportedTypeRow row = new ExportedTypeRow ();
230 row.Flags = _flags;
231 row.TypeDefId = _typeDefId;
232 row.TypeName = _typeName;
233 row.TypeNamespace = _typeNamespace;
234 row.Implementation = _implementation;
235 return row;
238 public FieldRow CreateFieldRow (FieldAttributes _flags, uint _name, uint _signature)
240 FieldRow row = new FieldRow ();
241 row.Flags = _flags;
242 row.Name = _name;
243 row.Signature = _signature;
244 return row;
247 public FieldLayoutRow CreateFieldLayoutRow (uint _offset, uint _field)
249 FieldLayoutRow row = new FieldLayoutRow ();
250 row.Offset = _offset;
251 row.Field = _field;
252 return row;
255 public FieldMarshalRow CreateFieldMarshalRow (MetadataToken _parent, uint _nativeType)
257 FieldMarshalRow row = new FieldMarshalRow ();
258 row.Parent = _parent;
259 row.NativeType = _nativeType;
260 return row;
263 public FieldPtrRow CreateFieldPtrRow (uint _field)
265 FieldPtrRow row = new FieldPtrRow ();
266 row.Field = _field;
267 return row;
270 public FieldRVARow CreateFieldRVARow (RVA _rVA, uint _field)
272 FieldRVARow row = new FieldRVARow ();
273 row.RVA = _rVA;
274 row.Field = _field;
275 return row;
278 public FileRow CreateFileRow (FileAttributes _flags, uint _name, uint _hashValue)
280 FileRow row = new FileRow ();
281 row.Flags = _flags;
282 row.Name = _name;
283 row.HashValue = _hashValue;
284 return row;
287 public GenericParamRow CreateGenericParamRow (ushort _number, GenericParameterAttributes _flags, MetadataToken _owner, uint _name)
289 GenericParamRow row = new GenericParamRow ();
290 row.Number = _number;
291 row.Flags = _flags;
292 row.Owner = _owner;
293 row.Name = _name;
294 return row;
297 public GenericParamConstraintRow CreateGenericParamConstraintRow (uint _owner, MetadataToken _constraint)
299 GenericParamConstraintRow row = new GenericParamConstraintRow ();
300 row.Owner = _owner;
301 row.Constraint = _constraint;
302 return row;
305 public ImplMapRow CreateImplMapRow (PInvokeAttributes _mappingFlags, MetadataToken _memberForwarded, uint _importName, uint _importScope)
307 ImplMapRow row = new ImplMapRow ();
308 row.MappingFlags = _mappingFlags;
309 row.MemberForwarded = _memberForwarded;
310 row.ImportName = _importName;
311 row.ImportScope = _importScope;
312 return row;
315 public InterfaceImplRow CreateInterfaceImplRow (uint _class, MetadataToken _interface)
317 InterfaceImplRow row = new InterfaceImplRow ();
318 row.Class = _class;
319 row.Interface = _interface;
320 return row;
323 public ManifestResourceRow CreateManifestResourceRow (uint _offset, ManifestResourceAttributes _flags, uint _name, MetadataToken _implementation)
325 ManifestResourceRow row = new ManifestResourceRow ();
326 row.Offset = _offset;
327 row.Flags = _flags;
328 row.Name = _name;
329 row.Implementation = _implementation;
330 return row;
333 public MemberRefRow CreateMemberRefRow (MetadataToken _class, uint _name, uint _signature)
335 MemberRefRow row = new MemberRefRow ();
336 row.Class = _class;
337 row.Name = _name;
338 row.Signature = _signature;
339 return row;
342 public MethodRow CreateMethodRow (RVA _rVA, MethodImplAttributes _implFlags, MethodAttributes _flags, uint _name, uint _signature, uint _paramList)
344 MethodRow row = new MethodRow ();
345 row.RVA = _rVA;
346 row.ImplFlags = _implFlags;
347 row.Flags = _flags;
348 row.Name = _name;
349 row.Signature = _signature;
350 row.ParamList = _paramList;
351 return row;
354 public MethodImplRow CreateMethodImplRow (uint _class, MetadataToken _methodBody, MetadataToken _methodDeclaration)
356 MethodImplRow row = new MethodImplRow ();
357 row.Class = _class;
358 row.MethodBody = _methodBody;
359 row.MethodDeclaration = _methodDeclaration;
360 return row;
363 public MethodPtrRow CreateMethodPtrRow (uint _method)
365 MethodPtrRow row = new MethodPtrRow ();
366 row.Method = _method;
367 return row;
370 public MethodSemanticsRow CreateMethodSemanticsRow (MethodSemanticsAttributes _semantics, uint _method, MetadataToken _association)
372 MethodSemanticsRow row = new MethodSemanticsRow ();
373 row.Semantics = _semantics;
374 row.Method = _method;
375 row.Association = _association;
376 return row;
379 public MethodSpecRow CreateMethodSpecRow (MetadataToken _method, uint _instantiation)
381 MethodSpecRow row = new MethodSpecRow ();
382 row.Method = _method;
383 row.Instantiation = _instantiation;
384 return row;
387 public ModuleRow CreateModuleRow (ushort _generation, uint _name, uint _mvid, uint _encId, uint _encBaseId)
389 ModuleRow row = new ModuleRow ();
390 row.Generation = _generation;
391 row.Name = _name;
392 row.Mvid = _mvid;
393 row.EncId = _encId;
394 row.EncBaseId = _encBaseId;
395 return row;
398 public ModuleRefRow CreateModuleRefRow (uint _name)
400 ModuleRefRow row = new ModuleRefRow ();
401 row.Name = _name;
402 return row;
405 public NestedClassRow CreateNestedClassRow (uint _nestedClass, uint _enclosingClass)
407 NestedClassRow row = new NestedClassRow ();
408 row.NestedClass = _nestedClass;
409 row.EnclosingClass = _enclosingClass;
410 return row;
413 public ParamRow CreateParamRow (ParameterAttributes _flags, ushort _sequence, uint _name)
415 ParamRow row = new ParamRow ();
416 row.Flags = _flags;
417 row.Sequence = _sequence;
418 row.Name = _name;
419 return row;
422 public ParamPtrRow CreateParamPtrRow (uint _param)
424 ParamPtrRow row = new ParamPtrRow ();
425 row.Param = _param;
426 return row;
429 public PropertyRow CreatePropertyRow (PropertyAttributes _flags, uint _name, uint _type)
431 PropertyRow row = new PropertyRow ();
432 row.Flags = _flags;
433 row.Name = _name;
434 row.Type = _type;
435 return row;
438 public PropertyMapRow CreatePropertyMapRow (uint _parent, uint _propertyList)
440 PropertyMapRow row = new PropertyMapRow ();
441 row.Parent = _parent;
442 row.PropertyList = _propertyList;
443 return row;
446 public PropertyPtrRow CreatePropertyPtrRow (uint _property)
448 PropertyPtrRow row = new PropertyPtrRow ();
449 row.Property = _property;
450 return row;
453 public StandAloneSigRow CreateStandAloneSigRow (uint _signature)
455 StandAloneSigRow row = new StandAloneSigRow ();
456 row.Signature = _signature;
457 return row;
460 public TypeDefRow CreateTypeDefRow (TypeAttributes _flags, uint _name, uint _namespace, MetadataToken _extends, uint _fieldList, uint _methodList)
462 TypeDefRow row = new TypeDefRow ();
463 row.Flags = _flags;
464 row.Name = _name;
465 row.Namespace = _namespace;
466 row.Extends = _extends;
467 row.FieldList = _fieldList;
468 row.MethodList = _methodList;
469 return row;
472 public TypeRefRow CreateTypeRefRow (MetadataToken _resolutionScope, uint _name, uint _namespace)
474 TypeRefRow row = new TypeRefRow ();
475 row.ResolutionScope = _resolutionScope;
476 row.Name = _name;
477 row.Namespace = _namespace;
478 return row;
481 public TypeSpecRow CreateTypeSpecRow (uint _signature)
483 TypeSpecRow row = new TypeSpecRow ();
484 row.Signature = _signature;
485 return row;
488 public override void VisitRowCollection (RowCollection coll)
490 m_blobHeapIdxSz = m_root.Streams.BlobHeap != null ?
491 m_root.Streams.BlobHeap.IndexSize : 2;
492 m_stringsHeapIdxSz = m_root.Streams.StringsHeap != null ?
493 m_root.Streams.StringsHeap.IndexSize : 2;
494 m_guidHeapIdxSz = m_root.Streams.GuidHeap != null ?
495 m_root.Streams.GuidHeap.IndexSize : 2;
498 public override void VisitAssemblyRow (AssemblyRow row)
500 m_binaryWriter.Write ((uint) row.HashAlgId);
501 m_binaryWriter.Write (row.MajorVersion);
502 m_binaryWriter.Write (row.MinorVersion);
503 m_binaryWriter.Write (row.BuildNumber);
504 m_binaryWriter.Write (row.RevisionNumber);
505 m_binaryWriter.Write ((uint) row.Flags);
506 WriteBlobPointer (row.PublicKey);
507 WriteStringPointer (row.Name);
508 WriteStringPointer (row.Culture);
511 public override void VisitAssemblyOSRow (AssemblyOSRow row)
513 m_binaryWriter.Write (row.OSPlatformID);
514 m_binaryWriter.Write (row.OSMajorVersion);
515 m_binaryWriter.Write (row.OSMinorVersion);
518 public override void VisitAssemblyProcessorRow (AssemblyProcessorRow row)
520 m_binaryWriter.Write (row.Processor);
523 public override void VisitAssemblyRefRow (AssemblyRefRow row)
525 m_binaryWriter.Write (row.MajorVersion);
526 m_binaryWriter.Write (row.MinorVersion);
527 m_binaryWriter.Write (row.BuildNumber);
528 m_binaryWriter.Write (row.RevisionNumber);
529 m_binaryWriter.Write ((uint) row.Flags);
530 WriteBlobPointer (row.PublicKeyOrToken);
531 WriteStringPointer (row.Name);
532 WriteStringPointer (row.Culture);
533 WriteBlobPointer (row.HashValue);
536 public override void VisitAssemblyRefOSRow (AssemblyRefOSRow row)
538 m_binaryWriter.Write (row.OSPlatformID);
539 m_binaryWriter.Write (row.OSMajorVersion);
540 m_binaryWriter.Write (row.OSMinorVersion);
541 WriteTablePointer (row.AssemblyRef, AssemblyRefTable.RId);
544 public override void VisitAssemblyRefProcessorRow (AssemblyRefProcessorRow row)
546 m_binaryWriter.Write (row.Processor);
547 WriteTablePointer (row.AssemblyRef, AssemblyRefTable.RId);
550 public override void VisitClassLayoutRow (ClassLayoutRow row)
552 m_binaryWriter.Write (row.PackingSize);
553 m_binaryWriter.Write (row.ClassSize);
554 WriteTablePointer (row.Parent, TypeDefTable.RId);
557 public override void VisitConstantRow (ConstantRow row)
559 m_binaryWriter.Write ((ushort) row.Type);
560 WriteMetadataToken (row.Parent, CodedIndex.HasConstant);
561 WriteBlobPointer (row.Value);
564 public override void VisitCustomAttributeRow (CustomAttributeRow row)
566 WriteMetadataToken (row.Parent, CodedIndex.HasCustomAttribute);
567 WriteMetadataToken (row.Type, CodedIndex.CustomAttributeType);
568 WriteBlobPointer (row.Value);
571 public override void VisitDeclSecurityRow (DeclSecurityRow row)
573 m_binaryWriter.Write ((short) row.Action);
574 WriteMetadataToken (row.Parent, CodedIndex.HasDeclSecurity);
575 WriteBlobPointer (row.PermissionSet);
578 public override void VisitEventRow (EventRow row)
580 m_binaryWriter.Write ((ushort) row.EventFlags);
581 WriteStringPointer (row.Name);
582 WriteMetadataToken (row.EventType, CodedIndex.TypeDefOrRef);
585 public override void VisitEventMapRow (EventMapRow row)
587 WriteTablePointer (row.Parent, TypeDefTable.RId);
588 WriteTablePointer (row.EventList, EventTable.RId);
591 public override void VisitEventPtrRow (EventPtrRow row)
593 WriteTablePointer (row.Event, EventTable.RId);
596 public override void VisitExportedTypeRow (ExportedTypeRow row)
598 m_binaryWriter.Write ((uint) row.Flags);
599 m_binaryWriter.Write (row.TypeDefId);
600 WriteStringPointer (row.TypeName);
601 WriteStringPointer (row.TypeNamespace);
602 WriteMetadataToken (row.Implementation, CodedIndex.Implementation);
605 public override void VisitFieldRow (FieldRow row)
607 m_binaryWriter.Write ((ushort) row.Flags);
608 WriteStringPointer (row.Name);
609 WriteBlobPointer (row.Signature);
612 public override void VisitFieldLayoutRow (FieldLayoutRow row)
614 m_binaryWriter.Write (row.Offset);
615 WriteTablePointer (row.Field, FieldTable.RId);
618 public override void VisitFieldMarshalRow (FieldMarshalRow row)
620 WriteMetadataToken (row.Parent, CodedIndex.HasFieldMarshal);
621 WriteBlobPointer (row.NativeType);
624 public override void VisitFieldPtrRow (FieldPtrRow row)
626 WriteTablePointer (row.Field, FieldTable.RId);
629 public override void VisitFieldRVARow (FieldRVARow row)
631 m_binaryWriter.Write (row.RVA.Value);
632 WriteTablePointer (row.Field, FieldTable.RId);
635 public override void VisitFileRow (FileRow row)
637 m_binaryWriter.Write ((uint) row.Flags);
638 WriteStringPointer (row.Name);
639 WriteBlobPointer (row.HashValue);
642 public override void VisitGenericParamRow (GenericParamRow row)
644 m_binaryWriter.Write (row.Number);
645 m_binaryWriter.Write ((ushort) row.Flags);
646 WriteMetadataToken (row.Owner, CodedIndex.TypeOrMethodDef);
647 WriteStringPointer (row.Name);
650 public override void VisitGenericParamConstraintRow (GenericParamConstraintRow row)
652 WriteTablePointer (row.Owner, GenericParamTable.RId);
653 WriteMetadataToken (row.Constraint, CodedIndex.TypeDefOrRef);
656 public override void VisitImplMapRow (ImplMapRow row)
658 m_binaryWriter.Write ((ushort) row.MappingFlags);
659 WriteMetadataToken (row.MemberForwarded, CodedIndex.MemberForwarded);
660 WriteStringPointer (row.ImportName);
661 WriteTablePointer (row.ImportScope, ModuleRefTable.RId);
664 public override void VisitInterfaceImplRow (InterfaceImplRow row)
666 WriteTablePointer (row.Class, TypeDefTable.RId);
667 WriteMetadataToken (row.Interface, CodedIndex.TypeDefOrRef);
670 public override void VisitManifestResourceRow (ManifestResourceRow row)
672 m_binaryWriter.Write (row.Offset);
673 m_binaryWriter.Write ((uint) row.Flags);
674 WriteStringPointer (row.Name);
675 WriteMetadataToken (row.Implementation, CodedIndex.Implementation);
678 public override void VisitMemberRefRow (MemberRefRow row)
680 WriteMetadataToken (row.Class, CodedIndex.MemberRefParent);
681 WriteStringPointer (row.Name);
682 WriteBlobPointer (row.Signature);
685 public override void VisitMethodRow (MethodRow row)
687 m_binaryWriter.Write (row.RVA.Value);
688 m_binaryWriter.Write ((ushort) row.ImplFlags);
689 m_binaryWriter.Write ((ushort) row.Flags);
690 WriteStringPointer (row.Name);
691 WriteBlobPointer (row.Signature);
692 WriteTablePointer (row.ParamList, ParamTable.RId);
695 public override void VisitMethodImplRow (MethodImplRow row)
697 WriteTablePointer (row.Class, TypeDefTable.RId);
698 WriteMetadataToken (row.MethodBody, CodedIndex.MethodDefOrRef);
699 WriteMetadataToken (row.MethodDeclaration, CodedIndex.MethodDefOrRef);
702 public override void VisitMethodPtrRow (MethodPtrRow row)
704 WriteTablePointer (row.Method, MethodTable.RId);
707 public override void VisitMethodSemanticsRow (MethodSemanticsRow row)
709 m_binaryWriter.Write ((ushort) row.Semantics);
710 WriteTablePointer (row.Method, MethodTable.RId);
711 WriteMetadataToken (row.Association, CodedIndex.HasSemantics);
714 public override void VisitMethodSpecRow (MethodSpecRow row)
716 WriteMetadataToken (row.Method, CodedIndex.MethodDefOrRef);
717 WriteBlobPointer (row.Instantiation);
720 public override void VisitModuleRow (ModuleRow row)
722 m_binaryWriter.Write (row.Generation);
723 WriteStringPointer (row.Name);
724 WriteGuidPointer (row.Mvid);
725 WriteGuidPointer (row.EncId);
726 WriteGuidPointer (row.EncBaseId);
729 public override void VisitModuleRefRow (ModuleRefRow row)
731 WriteStringPointer (row.Name);
734 public override void VisitNestedClassRow (NestedClassRow row)
736 WriteTablePointer (row.NestedClass, TypeDefTable.RId);
737 WriteTablePointer (row.EnclosingClass, TypeDefTable.RId);
740 public override void VisitParamRow (ParamRow row)
742 m_binaryWriter.Write ((ushort) row.Flags);
743 m_binaryWriter.Write (row.Sequence);
744 WriteStringPointer (row.Name);
747 public override void VisitParamPtrRow (ParamPtrRow row)
749 WriteTablePointer (row.Param, ParamTable.RId);
752 public override void VisitPropertyRow (PropertyRow row)
754 m_binaryWriter.Write ((ushort) row.Flags);
755 WriteStringPointer (row.Name);
756 WriteBlobPointer (row.Type);
759 public override void VisitPropertyMapRow (PropertyMapRow row)
761 WriteTablePointer (row.Parent, TypeDefTable.RId);
762 WriteTablePointer (row.PropertyList, PropertyTable.RId);
765 public override void VisitPropertyPtrRow (PropertyPtrRow row)
767 WriteTablePointer (row.Property, PropertyTable.RId);
770 public override void VisitStandAloneSigRow (StandAloneSigRow row)
772 WriteBlobPointer (row.Signature);
775 public override void VisitTypeDefRow (TypeDefRow row)
777 m_binaryWriter.Write ((uint) row.Flags);
778 WriteStringPointer (row.Name);
779 WriteStringPointer (row.Namespace);
780 WriteMetadataToken (row.Extends, CodedIndex.TypeDefOrRef);
781 WriteTablePointer (row.FieldList, FieldTable.RId);
782 WriteTablePointer (row.MethodList, MethodTable.RId);
785 public override void VisitTypeRefRow (TypeRefRow row)
787 WriteMetadataToken (row.ResolutionScope, CodedIndex.ResolutionScope);
788 WriteStringPointer (row.Name);
789 WriteStringPointer (row.Namespace);
792 public override void VisitTypeSpecRow (TypeSpecRow row)
794 WriteBlobPointer (row.Signature);