Skip to content

Commit 1481150

Browse files
carlossanlopThraka
andcommitted
Automatically port Reflection.Metadata A-D APIs (#3200)
* Automatically port Reflection.Metadata A-D APIs * suggestion by Thraka Co-Authored-By: Andy De George <[email protected]>
1 parent 21b61f2 commit 1481150

10 files changed

+255
-28
lines changed

xml/System.Reflection.Metadata/AssemblyFile.xml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,15 @@
5252
<summary>Gets a value that indicates whether the file contains metadata.</summary>
5353
<value>
5454
<see langword="true" /> if the file contains metadata, <see langword="false" /> otherwise.</value>
55-
<remarks>To be added.</remarks>
55+
<remarks>
56+
<format type="text/markdown"><![CDATA[
57+
58+
## Remarks
59+
60+
Corresponds to the `Flags` field of the `File` table in the ECMA-335 Standard.
61+
62+
]]></format>
63+
</remarks>
5664
</Docs>
5765
</Member>
5866
<Member MemberName="GetCustomAttributes">
@@ -105,7 +113,15 @@
105113
<Docs>
106114
<summary>Gets the hash value of the file content calculated using <see cref="P:System.Reflection.Metadata.AssemblyDefinition.HashAlgorithm" />.</summary>
107115
<value>A <see cref="T:System.Reflection.Metadata.BlobHandle" /> instance representing the hash value of the file content.</value>
108-
<remarks>To be added.</remarks>
116+
<remarks>
117+
<format type="text/markdown"><![CDATA[
118+
119+
## Remarks
120+
121+
Corresponds to the `HashValue` field of the `File` table in the ECMA-335 Standard.
122+
123+
]]></format>
124+
</remarks>
109125
</Docs>
110126
</Member>
111127
<Member MemberName="Name">
@@ -131,7 +147,15 @@
131147
<Docs>
132148
<summary>Gets the file name, including its extension.</summary>
133149
<value>A <see cref="T:System.Reflection.Metadata.StringHandle" /> instance representing the file name with its extension.</value>
134-
<remarks>To be added.</remarks>
150+
<remarks>
151+
<format type="text/markdown"><![CDATA[
152+
153+
## Remarks
154+
155+
Corresponds to the `Name` field of the `File` table in the ECMA-335 Standard.
156+
157+
]]></format>
158+
</remarks>
135159
</Docs>
136160
</Member>
137161
</Members>

xml/System.Reflection.Metadata/AssemblyFileHandleCollection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</Attribute>
3838
</Attributes>
3939
<Docs>
40-
<summary>To be added.</summary>
40+
<summary>Represents a collection of <see cref="T:System.Reflection.Metadata.AssemblyFileHandle" />.</summary>
4141
<remarks>To be added.</remarks>
4242
</Docs>
4343
<Members>

xml/System.Reflection.Metadata/AssemblyReferenceHandleCollection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</Attribute>
3838
</Attributes>
3939
<Docs>
40-
<summary>To be added.</summary>
40+
<summary>A collection of assembly references.</summary>
4141
<remarks>To be added.</remarks>
4242
</Docs>
4343
<Members>

xml/System.Reflection.Metadata/BlobBuilder.xml

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,19 @@
850850
<Docs>
851851
<param name="value">The value to write.</param>
852852
<summary>Implements compressed unsigned integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.</summary>
853-
<remarks>To be added.</remarks>
853+
<remarks>
854+
<format type="text/markdown"><![CDATA[
855+
856+
## Remarks
857+
858+
If the value lies between 0 (0x00) and 127 (0x7F), inclusive, encode as a one-byte integer (bit 7 is clear, value held in bits 6 through 0).
859+
860+
If the value lies between 28 (0x80) and 214 - 1 (0x3FFF), inclusive, encode as a 2-byte integer with bit 15 set, bit 14 clear (value held in bits 13 through 0).
861+
862+
Otherwise, encode as a 4-byte integer, with bit 31 set, bit 30 set, bit 29 clear (value held in bits 28 through 0).
863+
864+
]]></format>
865+
</remarks>
854866
<exception cref="T:System.ArgumentOutOfRangeException">
855867
<paramref name="value" /> can't be represented as a compressed unsigned integer.</exception>
856868
<exception cref="T:System.InvalidOperationException">The builder is not writable; it has been linked with another one.</exception>
@@ -880,7 +892,19 @@
880892
<Docs>
881893
<param name="value">The value to write.</param>
882894
<summary>Implements compressed signed integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.</summary>
883-
<remarks>To be added.</remarks>
895+
<remarks>
896+
<format type="text/markdown"><![CDATA[
897+
898+
## Remarks
899+
900+
If the value lies between -64 (0xFFFFFFC0) and 63 (0x3F), inclusive, encode as a one-byte integer: bit 7 clear, value bits 5 through 0 held in bits 6 through 1, sign bit (value bit 31) in bit 0.
901+
902+
If the value lies between -8192 (0xFFFFE000) and 8191 (0x1FFF), inclusive, encode as a two-byte integer: 15 set, bit 14 clear, value bits 12 through 0 held in bits 13 through 1, sign bit(value bit 31) in bit 0.
903+
904+
If the value lies between -268435456 (0xF000000) and 268435455 (0x0FFFFFFF), inclusive, encode as a four-byte integer: 31 set, 30 set, bit 29 clear, value bits 27 through 0 held in bits 28 through 1, sign bit(value bit 31) in bit 0.
905+
906+
]]></format>
907+
</remarks>
884908
<exception cref="T:System.ArgumentOutOfRangeException">
885909
<paramref name="value" /> can't be represented as a compressed signed integer.</exception>
886910
<exception cref="T:System.InvalidOperationException">The builder is not writable; it has been linked with another one.</exception>
@@ -1341,7 +1365,17 @@
13411365
<Docs>
13421366
<param name="value">To be added.</param>
13431367
<summary>Writes a string in SerString format (see ECMA-335-II 23.3 Custom attributes).</summary>
1344-
<remarks>To be added.</remarks>
1368+
<remarks>
1369+
<format type="text/markdown"><![CDATA[
1370+
1371+
## Remarks
1372+
1373+
The string is UTF8 encoded and prefixed by the its size in bytes.
1374+
1375+
A `null` string is represented as a single byte 0xFF.
1376+
1377+
]]></format>
1378+
</remarks>
13451379
<exception cref="T:System.InvalidOperationException">Builder is not writable, it has been linked with another one.</exception>
13461380
</Docs>
13471381
</Member>
@@ -1537,7 +1571,19 @@
15371571
<Docs>
15381572
<param name="value">To be added.</param>
15391573
<summary>Writes a string in User String (#US) heap format (see ECMA-335-II 24.2.4 #US and #Blob heaps).</summary>
1540-
<remarks>To be added.</remarks>
1574+
<remarks>
1575+
<format type="text/markdown"><![CDATA[
1576+
1577+
## Remarks
1578+
1579+
The string is UTF16 encoded and prefixed by the its size in bytes.
1580+
1581+
This final byte holds the value 1 if and only if any UTF16 character within the string has any bit set in its top byte, or its low byte is any of the following: 0x01-0x08, 0x0E-0x1F, 0x27, 0x2D, 0x7F. Otherwise, it holds 0.
1582+
1583+
The 1 signifies Unicode characters that require handling beyond that normally provided for 8-bit encoding sets.
1584+
1585+
]]></format>
1586+
</remarks>
15411587
<exception cref="T:System.InvalidOperationException">Builder is not writable, it has been linked with another one.</exception>
15421588
</Docs>
15431589
</Member>

xml/System.Reflection.Metadata/BlobReader.xml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,15 @@
134134
<param name="value">The byte value to find.</param>
135135
<summary>Searches for a specified byte in the blob following the current position.</summary>
136136
<returns>The index relative to the current position, or -1 if the byte is not found in the blob following the current position.</returns>
137-
<remarks>To be added.</remarks>
137+
<remarks>
138+
<format type="text/markdown"><![CDATA[
139+
140+
## Remarks
141+
142+
Doesn't change the current position.
143+
144+
]]></format>
145+
</remarks>
138146
</Docs>
139147
</Member>
140148
<Member MemberName="Length">
@@ -217,7 +225,15 @@
217225
<Docs>
218226
<summary>Reads a Blob heap handle encoded as a compressed integer.</summary>
219227
<returns>To be added.</returns>
220-
<remarks>To be added.</remarks>
228+
<remarks>
229+
<format type="text/markdown"><![CDATA[
230+
231+
## Remarks
232+
233+
Blobs that contain references to other blobs are used in Portable PDB format, for example <xref:System.Reflection.Metadata.Document.Name>.
234+
235+
]]></format>
236+
</remarks>
221237
</Docs>
222238
</Member>
223239
<Member MemberName="ReadBoolean">
@@ -503,7 +519,18 @@
503519
<Docs>
504520
<summary>Reads a <see cref="T:System.Decimal" /> number.</summary>
505521
<returns>To be added.</returns>
506-
<remarks>To be added.</remarks>
522+
<remarks>
523+
<format type="text/markdown"><![CDATA[
524+
525+
## Remarks
526+
527+
Decimal number is encoded in 13 bytes as follows:
528+
529+
- byte 0: highest bit indicates sign (1 for negative, 0 for non-negative); the remaining 7 bits encode scale.
530+
- bytes 1..12: 96-bit unsigned integer in little endian encoding.
531+
532+
]]></format>
533+
</remarks>
507534
<exception cref="T:System.BadImageFormatException">The data at the current position was not a valid <see cref="T:System.Decimal" /> number.</exception>
508535
</Docs>
509536
</Member>
@@ -720,7 +747,15 @@
720747
<Docs>
721748
<summary>Reads a string encoded as a compressed integer containing its length followed by its contents in UTF8. Null strings are encoded as a single 0xFF byte.</summary>
722749
<returns>A string value, or <see langword="null" />.</returns>
723-
<remarks>To be added.</remarks>
750+
<remarks>
751+
<format type="text/markdown"><![CDATA[
752+
753+
## Remarks
754+
755+
Defined as a 'SerString' in the ECMA CLI specification.
756+
757+
]]></format>
758+
</remarks>
724759
<exception cref="T:System.BadImageFormatException">The encoding is invalid.</exception>
725760
</Docs>
726761
</Member>

xml/System.Reflection.Metadata/BlobWriter.xml

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,19 @@
764764
<Docs>
765765
<param name="value">To be added.</param>
766766
<summary>Implements compressed unsigned integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.</summary>
767-
<remarks>To be added.</remarks>
767+
<remarks>
768+
<format type="text/markdown"><![CDATA[
769+
770+
## Remarks
771+
772+
If the value lies between 0 (0x00) and 127 (0x7F), inclusive, encode as a one-byte integer (bit 7 is clear, value held in bits 6 through 0).
773+
774+
If the value lies between 28 (0x80) and 214 - 1 (0x3FFF), inclusive, encode as a 2-byte integer with bit 15 set, bit 14 clear (value held in bits 13 through 0).
775+
776+
Otherwise, encode as a 4-byte integer, with bit 31 set, bit 30 set, bit 29 clear (value held in bits 28 through 0).
777+
778+
]]></format>
779+
</remarks>
768780
<exception cref="T:System.ArgumentOutOfRangeException">
769781
<paramref name="value" /> can't be represented as a compressed unsigned integer.</exception>
770782
</Docs>
@@ -793,7 +805,19 @@
793805
<Docs>
794806
<param name="value">To be added.</param>
795807
<summary>Implements compressed signed integer encoding as defined by ECMA-335-II chapter 23.2: Blobs and signatures.</summary>
796-
<remarks>To be added.</remarks>
808+
<remarks>
809+
<format type="text/markdown"><![CDATA[
810+
811+
## Remarks
812+
813+
If the value lies between -64 (0xFFFFFFC0) and 63 (0x3F), inclusive, encode as a one-byte integer: bit 7 clear, value bits 5 through 0 held in bits 6 through 1, sign bit (value bit 31) in bit 0.
814+
815+
If the value lies between -8192 (0xFFFFE000) and 8191 (0x1FFF), inclusive, encode as a two-byte integer: 15 set, bit 14 clear, value bits 12 through 0 held in bits 13 through 1, sign bit(value bit 31) in bit 0.
816+
817+
If the value lies between -268435456 (0xF000000) and 268435455 (0x0FFFFFFF), inclusive, encode as a four-byte integer: 31 set, 30 set, bit 29 clear, value bits 27 through 0 held in bits 28 through 1, sign bit(value bit 31) in bit 0.
818+
819+
]]></format>
820+
</remarks>
797821
<exception cref="T:System.ArgumentOutOfRangeException">
798822
<paramref name="value" /> can't be represented as a compressed signed integer.</exception>
799823
</Docs>
@@ -1151,7 +1175,17 @@
11511175
<Docs>
11521176
<param name="str">To be added.</param>
11531177
<summary>Writes a string in SerString format (see ECMA-335-II 23.3 Custom attributes).</summary>
1154-
<remarks>To be added.</remarks>
1178+
<remarks>
1179+
<format type="text/markdown"><![CDATA[
1180+
1181+
## Remarks
1182+
1183+
The string is UTF8 encoded and prefixed by the its size in bytes.
1184+
1185+
A `null` string is represented as a single byte 0xFF.
1186+
1187+
]]></format>
1188+
</remarks>
11551189
<exception cref="T:System.InvalidOperationException">The builder is not writable; it has been linked with another one.</exception>
11561190
</Docs>
11571191
</Member>
@@ -1341,7 +1375,19 @@
13411375
<Docs>
13421376
<param name="value">To be added.</param>
13431377
<summary>Writes a string in User String (#US) heap format (see ECMA-335-II 24.2.4 #US and #Blob heaps).</summary>
1344-
<remarks>To be added.</remarks>
1378+
<remarks>
1379+
<format type="text/markdown"><![CDATA[
1380+
1381+
## Remarks
1382+
1383+
The string is UTF16 encoded and prefixed by the its size in bytes.
1384+
1385+
This final byte holds the value 1 if and only if any UTF16 character within the string has any bit set in its top byte, or its low byte is any of the following: 0x01-0x08, 0x0E-0x1F, 0x27, 0x2D, 0x7F. Otherwise, it holds 0.
1386+
1387+
The 1 signifies Unicode characters that require handling beyond that normally provided for 8-bit encoding sets.
1388+
1389+
]]></format>
1390+
</remarks>
13451391
<exception cref="T:System.InvalidOperationException">Builder is not writable, it has been linked with another one.</exception>
13461392
</Docs>
13471393
</Member>

xml/System.Reflection.Metadata/Constant.xml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@
5151
<Docs>
5252
<summary>Gets the parent handle (<see cref="T:System.Reflection.Metadata.ParameterHandle" />, <see cref="T:System.Reflection.Metadata.FieldDefinitionHandle" />, or <see cref="T:System.Reflection.Metadata.PropertyDefinitionHandle" />).</summary>
5353
<value>To be added.</value>
54-
<remarks>To be added.</remarks>
54+
<remarks>
55+
<format type="text/markdown"><![CDATA[
56+
57+
## Remarks
58+
59+
Corresponds to the `Parent` field of the `Constant` table in the ECMA-335 Standard.
60+
61+
]]></format>
62+
</remarks>
5563
</Docs>
5664
</Member>
5765
<Member MemberName="TypeCode">
@@ -77,7 +85,15 @@
7785
<Docs>
7886
<summary>Gets a type code that identifies the type of the constant value.</summary>
7987
<value>To be added.</value>
80-
<remarks>To be added.</remarks>
88+
<remarks>
89+
<format type="text/markdown"><![CDATA[
90+
91+
## Remarks
92+
93+
Corresponds to the `Type` field of the `Constant` table in the ECMA-335 Standard.
94+
95+
]]></format>
96+
</remarks>
8197
</Docs>
8298
</Member>
8399
<Member MemberName="Value">
@@ -103,7 +119,15 @@
103119
<Docs>
104120
<summary>Gets the constant value.</summary>
105121
<value>To be added.</value>
106-
<remarks>To be added.</remarks>
122+
<remarks>
123+
<format type="text/markdown"><![CDATA[
124+
125+
## Remarks
126+
127+
Corresponds to the `Value` field of the `Constant` table in the ECMA-335 Standard.
128+
129+
]]></format>
130+
</remarks>
107131
</Docs>
108132
</Member>
109133
</Members>

0 commit comments

Comments
 (0)