Skip to content

Commit f0db820

Browse files
Automatic port of System.Text documentation (#4625)
* Automatic port of System.Text documentation * Apply suggestions from code review Co-authored-by: Genevieve Warren <[email protected]> Co-authored-by: carlossanlop <[email protected]> Co-authored-by: Genevieve Warren <[email protected]>
1 parent 777b90f commit f0db820

File tree

4 files changed

+116
-84
lines changed

4 files changed

+116
-84
lines changed

xml/System.Text/Encoding.xml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Type Name="Encoding" FullName="System.Text.Encoding">
1+
<Type Name="Encoding" FullName="System.Text.Encoding">
22
<TypeSignature Language="C#" Value="public abstract class Encoding" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netframework-1.1;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6" />
33
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit Encoding extends System.Object" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netstandard-1.0;netstandard-1.1;netstandard-1.2;netstandard-1.3;netstandard-1.4;netstandard-1.6" />
44
<TypeSignature Language="DocId" Value="T:System.Text.Encoding" />
@@ -982,13 +982,22 @@ The following table lists the encodings supported by .NET. It lists each encodin
982982
<Parameter Name="leaveOpen" Type="System.Boolean" Index="3" FrameworkAlternate="net-5.0" />
983983
</Parameters>
984984
<Docs>
985-
<param name="innerStream">To be added.</param>
986-
<param name="innerStreamEncoding">To be added.</param>
987-
<param name="outerStreamEncoding">To be added.</param>
988-
<param name="leaveOpen">To be added.</param>
989-
<summary>To be added.</summary>
990-
<returns>To be added.</returns>
991-
<remarks>To be added.</remarks>
985+
<param name="innerStream">The stream to wrap.</param>
986+
<param name="innerStreamEncoding">The encoding associated with <paramref name="innerStream" />.</param>
987+
<param name="outerStreamEncoding">The encoding associated with the <see cref="T:System.IO.Stream" /> that's returned by this method.</param>
988+
<param name="leaveOpen">
989+
<see langword="true" /> if disposing the <see cref="T:System.IO.Stream" /> returned by this method should <em>not</em> dispose <paramref name="innerStream" />.</param>
990+
<summary>Creates a <see cref="T:System.IO.Stream" /> that serves to transcode data between an inner <see cref="T:System.Text.Encoding" /> and an outer <see cref="T:System.Text.Encoding" />, similar to <see cref="M:System.Text.Encoding.Convert(System.Text.Encoding,System.Text.Encoding,System.Byte[])" />.</summary>
991+
<returns>A stream that transcodes the contents of <paramref name="innerStream" /> as <paramref name="outerStreamEncoding" />.</returns>
992+
<remarks>
993+
<format type="text/markdown"><![CDATA[
994+
995+
## Remarks
996+
997+
The returned <xref:System.IO.Stream>'s <xref:System.IO.Stream.CanRead> and <xref:System.IO.Stream.CanWrite> properties will reflect whether `innerStream` is readable or writable. If `innerStream` is full-duplex, the returned <xref:System.IO.Stream> will be as well. However, the returned <xref:System.IO.Stream> is not seekable, even if `innerStream`'s <xref:System.IO.Stream.CanSeek> property returns `true`.
998+
999+
]]></format>
1000+
</remarks>
9921001
</Docs>
9931002
</Member>
9941003
<Member MemberName="DecoderFallback">
@@ -5064,7 +5073,7 @@ The goal is to save this file, then open and decode it as a binary stream.
50645073
<ReturnType>System.Text.Encoding</ReturnType>
50655074
</ReturnValue>
50665075
<Docs>
5067-
<summary>To be added.</summary>
5076+
<summary>Gets an encoding for the Latin1 character set (ISO-8859-1).</summary>
50685077
<value>To be added.</value>
50695078
<remarks>To be added.</remarks>
50705079
</Docs>

xml/System.Text/EncodingExtensions.xml

Lines changed: 73 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Type Name="EncodingExtensions" FullName="System.Text.EncodingExtensions">
1+
<Type Name="EncodingExtensions" FullName="System.Text.EncodingExtensions">
22
<TypeSignature Language="C#" Value="public static class EncodingExtensions" />
33
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit EncodingExtensions extends System.Object" />
44
<TypeSignature Language="DocId" Value="T:System.Text.EncodingExtensions" />
@@ -49,13 +49,15 @@
4949
<Parameter Name="completed" Type="System.Boolean" RefType="out" />
5050
</Parameters>
5151
<Docs>
52-
<param name="decoder">To be added.</param>
53-
<param name="bytes">To be added.</param>
54-
<param name="writer">To be added.</param>
55-
<param name="flush">To be added.</param>
56-
<param name="charsUsed">To be added.</param>
57-
<param name="completed">To be added.</param>
58-
<summary>To be added.</summary>
52+
<param name="decoder">The decoder instance that can convert bytes to <see langword="char" /> values.</param>
53+
<param name="bytes">A sequence of bytes to decode.</param>
54+
<param name="writer">The buffer to which the decoded characters will be written.</param>
55+
<param name="flush">
56+
<see langword="true" /> to indicate no further data is to be converted; otherwise <see langword="false" />.</param>
57+
<param name="charsUsed">When this method returns, contains the count of characters that were written to <paramref name="writer" />.</param>
58+
<param name="completed">When this method returns, contains <see langword="true" /> if <paramref name="decoder" /> contains no partial internal state; otherwise, <see langword="false" />.
59+
If <paramref name="flush" /> is <see langword="true" />, this will always be set to <see langword="true" /> when the method returns.</param>
60+
<summary>Converts a <see cref="T:System.Buffers.ReadOnlySequence`1" /> to UTF-16 encoded characters and writes the result to <paramref name="writer" />.</summary>
5961
<remarks>To be added.</remarks>
6062
</Docs>
6163
</Member>
@@ -83,13 +85,15 @@
8385
<Parameter Name="completed" Type="System.Boolean" RefType="out" />
8486
</Parameters>
8587
<Docs>
86-
<param name="decoder">To be added.</param>
87-
<param name="bytes">To be added.</param>
88-
<param name="writer">To be added.</param>
89-
<param name="flush">To be added.</param>
90-
<param name="charsUsed">To be added.</param>
91-
<param name="completed">To be added.</param>
92-
<summary>To be added.</summary>
88+
<param name="decoder">The decoder instance that can convert bytes to <see langword="char" /> values.</param>
89+
<param name="bytes">A sequence of bytes to decode.</param>
90+
<param name="writer">The buffer to which the decoded chars will be written.</param>
91+
<param name="flush">
92+
<see langword="true" /> to indicate no further data is to be converted; otherwise <see langword="false" />.</param>
93+
<param name="charsUsed">When this method returns, contains the count of <see langword="char" />s which were written to <paramref name="writer" />.</param>
94+
<param name="completed">When this method returns, contains <see langword="true" /> if <paramref name="decoder" /> contains no partial internal state; otherwise, <see langword="false" />.
95+
If <paramref name="flush" /> is <see langword="true" />, this will always be set to <see langword="true" /> when the method returns.</param>
96+
<summary>Converts a <see cref="T:System.ReadOnlySpan`1" /> to chars using <paramref name="decoder" /> and writes the result to <paramref name="writer" />.</summary>
9397
<remarks>To be added.</remarks>
9498
</Docs>
9599
</Member>
@@ -124,13 +128,14 @@
124128
<Parameter Name="completed" Type="System.Boolean" RefType="out" />
125129
</Parameters>
126130
<Docs>
127-
<param name="encoder">To be added.</param>
128-
<param name="chars">To be added.</param>
129-
<param name="writer">To be added.</param>
130-
<param name="flush">To be added.</param>
131-
<param name="bytesUsed">To be added.</param>
132-
<param name="completed">To be added.</param>
133-
<summary>To be added.</summary>
131+
<param name="encoder">The encoder instance that can convert <see langword="char" /> values to bytes.</param>
132+
<param name="chars">A sequence of characters to encode.</param>
133+
<param name="writer">The buffer to which the encoded bytes will be written.</param>
134+
<param name="flush">
135+
<see langword="true" /> to indicate no further data is to be converted; otherwise <see langword="false" />.</param>
136+
<param name="bytesUsed">When this method returns, contains the count of <see langword="byte" />s which were written to <paramref name="writer" />.</param>
137+
<param name="completed">When this method returns, contains <see langword="true" /> if all input up until <paramref name="bytesUsed" /> was converted; otherwise, <see langword="false" />. If <paramref name="flush" /> is <see langword="true" />, this will always be set to <see langword="true" /> when the method returns.</param>
138+
<summary>Converts a <see cref="T:System.Buffers.ReadOnlySequence`1" /> to encoded bytes and writes the result to <paramref name="writer" />.</summary>
134139
<remarks>To be added.</remarks>
135140
</Docs>
136141
</Member>
@@ -158,13 +163,15 @@
158163
<Parameter Name="completed" Type="System.Boolean" RefType="out" />
159164
</Parameters>
160165
<Docs>
161-
<param name="encoder">To be added.</param>
162-
<param name="chars">To be added.</param>
163-
<param name="writer">To be added.</param>
164-
<param name="flush">To be added.</param>
165-
<param name="bytesUsed">To be added.</param>
166-
<param name="completed">To be added.</param>
167-
<summary>To be added.</summary>
166+
<param name="encoder">The encoder instance that can convert <see langword="char" /> values to bytes.</param>
167+
<param name="chars">A sequence of characters to encode.</param>
168+
<param name="writer">The buffer to which the encoded bytes will be written.</param>
169+
<param name="flush">
170+
<see langword="true" /> to indicate no further data is to be converted; otherwise <see langword="false" />.</param>
171+
<param name="bytesUsed">When this method returns, contains the count of <see langword="byte" />s which were written to <paramref name="writer" />.</param>
172+
<param name="completed">When this method returns, contains <see langword="true" /> if <paramref name="encoder" /> contains no partial internal state; otherwise, <see langword="false" />.
173+
If <paramref name="flush" /> is <see langword="true" />, this will always be set to <see langword="true" /> when the method returns.</param>
174+
<summary>Converts a <see cref="T:System.ReadOnlySpan`1" /> to bytes using <paramref name="encoder" /> and writes the result to <paramref name="writer" />.</summary>
168175
<remarks>To be added.</remarks>
169176
</Docs>
170177
</Member>
@@ -195,10 +202,10 @@
195202
</Parameter>
196203
</Parameters>
197204
<Docs>
198-
<param name="encoding">To be added.</param>
199-
<param name="chars">To be added.</param>
200-
<summary>To be added.</summary>
201-
<returns>To be added.</returns>
205+
<param name="encoding">The encoding that represents how the data in <paramref name="chars" /> should be encoded.</param>
206+
<param name="chars">The sequence to encode to bytes.</param>
207+
<summary>Encodes the specified <see cref="T:System.Buffers.ReadOnlySequence`1" /> into a <see cref="T:System.Byte" /> array using the specified <see cref="T:System.Text.Encoding" />.</summary>
208+
<returns>A <see cref="T:System.Byte" /> array that represents the encoded contents of <paramref name="chars" />.</returns>
202209
<remarks>To be added.</remarks>
203210
</Docs>
204211
</Member>
@@ -230,11 +237,11 @@
230237
<Parameter Name="writer" Type="System.Buffers.IBufferWriter&lt;System.Byte&gt;" />
231238
</Parameters>
232239
<Docs>
233-
<param name="encoding">To be added.</param>
234-
<param name="chars">To be added.</param>
235-
<param name="writer">To be added.</param>
236-
<summary>To be added.</summary>
237-
<returns>To be added.</returns>
240+
<param name="encoding">The encoding that represents how the data in <paramref name="chars" /> should be encoded.</param>
241+
<param name="chars">The <see cref="T:System.Buffers.ReadOnlySequence`1" /> whose contents should be encoded.</param>
242+
<param name="writer">The buffer to which the encoded bytes will be written.</param>
243+
<summary>Decodes the specified <see cref="T:System.Buffers.ReadOnlySequence`1" /> to <see langword="byte" />s using the specified <see cref="T:System.Text.Encoding" /> and writes the result to <paramref name="writer" />.</summary>
244+
<returns>The number of bytes written to <paramref name="writer" />.</returns>
238245
<remarks>To be added.</remarks>
239246
</Docs>
240247
</Member>
@@ -266,11 +273,11 @@
266273
<Parameter Name="bytes" Type="System.Span&lt;System.Byte&gt;" />
267274
</Parameters>
268275
<Docs>
269-
<param name="encoding">To be added.</param>
270-
<param name="chars">To be added.</param>
271-
<param name="bytes">To be added.</param>
272-
<summary>To be added.</summary>
273-
<returns>To be added.</returns>
276+
<param name="encoding">The encoding that represents how the data in <paramref name="chars" /> should be encoded.</param>
277+
<param name="chars">The sequence to encode to bytes.</param>
278+
<param name="bytes">The destination buffer to which the encoded bytes will be written.</param>
279+
<summary>Encodes the specified <see cref="T:System.Buffers.ReadOnlySequence`1" /> to <see langword="byte" />s using the specified <see cref="T:System.Text.Encoding" /> and outputs the result to <paramref name="bytes" />.</summary>
280+
<returns>The number of bytes written to <paramref name="bytes" />.</returns>
274281
<remarks>To be added.</remarks>
275282
</Docs>
276283
</Member>
@@ -295,10 +302,10 @@
295302
<Parameter Name="writer" Type="System.Buffers.IBufferWriter&lt;System.Byte&gt;" />
296303
</Parameters>
297304
<Docs>
298-
<param name="encoding">To be added.</param>
299-
<param name="chars">To be added.</param>
300-
<param name="writer">To be added.</param>
301-
<summary>To be added.</summary>
305+
<param name="encoding">The encoding that represents how the data in <paramref name="chars" /> should be encoded.</param>
306+
<param name="chars">The sequence to encode to bytes.</param>
307+
<param name="writer">The buffer to which the encoded bytes will be written.</param>
308+
<summary>Encodes the specified <see cref="T:System.ReadOnlySpan`1" /> to <see langword="byte" />s using the specified <see cref="T:System.Text.Encoding" /> and writes the result to <paramref name="writer" />.</summary>
302309
<returns>To be added.</returns>
303310
<remarks>To be added.</remarks>
304311
</Docs>
@@ -331,11 +338,11 @@
331338
<Parameter Name="writer" Type="System.Buffers.IBufferWriter&lt;System.Char&gt;" />
332339
</Parameters>
333340
<Docs>
334-
<param name="encoding">To be added.</param>
335-
<param name="bytes">To be added.</param>
336-
<param name="writer">To be added.</param>
337-
<summary>To be added.</summary>
338-
<returns>To be added.</returns>
341+
<param name="encoding">The encoding that represents how the data in <paramref name="bytes" /> should be decoded.</param>
342+
<param name="bytes">The sequence whose bytes should be decoded.</param>
343+
<param name="writer">The buffer to which the decoded chars will be written.</param>
344+
<summary>Decodes the specified <see cref="T:System.Buffers.ReadOnlySequence`1" /> to <see langword="char" />s using the specified <see cref="T:System.Text.Encoding" /> and writes the result to <paramref name="writer" />.</summary>
345+
<returns>The number of chars written to <paramref name="writer" />.</returns>
339346
<remarks>To be added.</remarks>
340347
</Docs>
341348
</Member>
@@ -367,11 +374,11 @@
367374
<Parameter Name="chars" Type="System.Span&lt;System.Char&gt;" />
368375
</Parameters>
369376
<Docs>
370-
<param name="encoding">To be added.</param>
371-
<param name="bytes">To be added.</param>
372-
<param name="chars">To be added.</param>
373-
<summary>To be added.</summary>
374-
<returns>To be added.</returns>
377+
<param name="encoding">The encoding that represents how the data in <paramref name="bytes" /> is encoded.</param>
378+
<param name="bytes">The sequence to decode to characters.</param>
379+
<param name="chars">The destination buffer to which the decoded characters will be written.</param>
380+
<summary>Decodes the specified <see cref="T:System.Buffers.ReadOnlySequence`1" /> to <see langword="char" />s using the specified <see cref="T:System.Text.Encoding" /> and outputs the result to <paramref name="chars" />.</summary>
381+
<returns>The number of chars written to <paramref name="chars" />.</returns>
375382
<remarks>To be added.</remarks>
376383
</Docs>
377384
</Member>
@@ -396,11 +403,11 @@
396403
<Parameter Name="writer" Type="System.Buffers.IBufferWriter&lt;System.Char&gt;" />
397404
</Parameters>
398405
<Docs>
399-
<param name="encoding">To be added.</param>
400-
<param name="bytes">To be added.</param>
401-
<param name="writer">To be added.</param>
402-
<summary>To be added.</summary>
403-
<returns>To be added.</returns>
406+
<param name="encoding">The encoding that represents how the data in <paramref name="bytes" /> should be decoded.</param>
407+
<param name="bytes">The span of bytes to decode.</param>
408+
<param name="writer">The buffer to which the decoded chars will be written.</param>
409+
<summary>Decodes the specified <see cref="T:System.ReadOnlySpan`1" /> to <see langword="char" />s using the specified <see cref="T:System.Text.Encoding" /> and writes the result to <paramref name="writer" />.</summary>
410+
<returns>The number of chars written to <paramref name="writer" />.</returns>
404411
<remarks>To be added.</remarks>
405412
</Docs>
406413
</Member>
@@ -431,10 +438,10 @@
431438
</Parameter>
432439
</Parameters>
433440
<Docs>
434-
<param name="encoding">To be added.</param>
435-
<param name="bytes">To be added.</param>
436-
<summary>To be added.</summary>
437-
<returns>To be added.</returns>
441+
<param name="encoding">The encoding that represents how the data in <paramref name="bytes" /> is encoded.</param>
442+
<param name="bytes">The sequence to decode into characters.</param>
443+
<summary>Decodes the specified <see cref="T:System.Buffers.ReadOnlySequence`1" /> into a <see cref="T:System.String" /> using the specified <see cref="T:System.Text.Encoding" />.</summary>
444+
<returns>A <see cref="T:System.String" /> which represents the decoded contents of <paramref name="bytes" />.</returns>
438445
<remarks>To be added.</remarks>
439446
</Docs>
440447
</Member>

xml/System.Text/EncodingInfo.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Type Name="EncodingInfo" FullName="System.Text.EncodingInfo">
1+
<Type Name="EncodingInfo" FullName="System.Text.EncodingInfo">
22
<TypeSignature Language="C#" Value="public sealed class EncodingInfo" />
33
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit EncodingInfo extends System.Object" FrameworkAlternate="net-5.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netstandard-2.0;netstandard-2.1" />
44
<TypeSignature Language="DocId" Value="T:System.Text.EncodingInfo" />
@@ -83,11 +83,11 @@
8383
<Parameter Name="displayName" Type="System.String" Index="3" FrameworkAlternate="net-5.0" />
8484
</Parameters>
8585
<Docs>
86-
<param name="provider">To be added.</param>
87-
<param name="codePage">To be added.</param>
88-
<param name="name">To be added.</param>
89-
<param name="displayName">To be added.</param>
90-
<summary>To be added.</summary>
86+
<param name="provider">The provider that created this <see cref="T:System.Text.EncodingInfo" /> object.</param>
87+
<param name="codePage">The encoding codepage.</param>
88+
<param name="name">The encoding name.</param>
89+
<param name="displayName">The encoding display name.</param>
90+
<summary>Constructs an <see cref="T:System.Text.EncodingInfo" /> object.</summary>
9191
<remarks>To be added.</remarks>
9292
</Docs>
9393
</Member>

0 commit comments

Comments
 (0)