Skip to content

Commit 684dbf4

Browse files
carlossanlopRon Petrusha
authored andcommitted
coreclr: Automatic port of triple slash from System.IO (#2724)
* coreclr: Automatic port of triple slash from System.IO * Suggestions by mairaw Co-Authored-By: Maira Wenzel <[email protected]> * missing returns in EndsInDirectorySeparator * Update for GetDirectoryName * mairaw's commits * Additional merge conflicts * spacing * spacing * Update Path.xml
1 parent 5337181 commit 684dbf4

File tree

3 files changed

+64
-25
lines changed

3 files changed

+64
-25
lines changed

xml/System.IO/Path.xml

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,9 @@ The following example displays <xref:System.IO.Path> field values on Windows and
647647
<Parameter Name="path" Type="System.ReadOnlySpan&lt;System.Char&gt;" Index="0" FrameworkAlternate="netcore-3.0" />
648648
</Parameters>
649649
<Docs>
650-
<param name="path">To be added.</param>
651-
<summary>To be added.</summary>
652-
<returns>To be added.</returns>
650+
<param name="path">The path to analyze.</param>
651+
<summary>Returns a value that indicates whether the path, specified as a read-only span, ends in a directory separator.</summary>
652+
<returns><see langword="true" /> if the path ends in a directory separator; otherwise, <see langword="false" />.</returns>
653653
<remarks>To be added.</remarks>
654654
</Docs>
655655
</Member>
@@ -678,9 +678,9 @@ The following example displays <xref:System.IO.Path> field values on Windows and
678678
<Parameter Name="path" Type="System.String" Index="0" FrameworkAlternate="netcore-3.0" />
679679
</Parameters>
680680
<Docs>
681-
<param name="path">To be added.</param>
682-
<summary>To be added.</summary>
683-
<returns>To be added.</returns>
681+
<param name="path">The path to analyze.</param>
682+
<summary>Returns a value that indicates whether the specified path ends in a directory separator.</summary>
683+
<returns><see langword="true" /> if the path ends in a directory separator; otherwise, <see langword="false" />.</returns>
684684
<remarks>To be added.</remarks>
685685
</Docs>
686686
</Member>
@@ -710,10 +710,18 @@ The following example displays <xref:System.IO.Path> field values on Windows and
710710
<Parameter Name="path" Type="System.ReadOnlySpan&lt;System.Char&gt;" Index="0" FrameworkAlternate="netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1" />
711711
</Parameters>
712712
<Docs>
713-
<param name="path">To be added.</param>
713+
<param name="path">The path to retrieve the directory information from.</param>
714714
<summary>Returns the directory information for the specified path represented by a character span.</summary>
715715
<returns>Directory information for <paramref name="path" />, or an empty span if <paramref name="path" /> is <see langword="null" />, an empty span, or a root (such as \, C:, or \\server\share).</returns>
716-
<remarks>To be added.</remarks>
716+
<remarks>
717+
<format type="text/markdown"><![CDATA[
718+
719+
## Remarks
720+
721+
Unlike the string overload, this method doesn't normalize directory separators.
722+
723+
]]></format>
724+
</remarks>
717725
<related type="Article" href="~/docs/standard/io/file-path-formats.md">File path formats on Windows systems</related>
718726
</Docs>
719727
</Member>
@@ -1393,7 +1401,15 @@ The following example defines a variable, `basePath`, to represent an applicatio
13931401
<param name="path">The path from which to obtain root directory information.</param>
13941402
<summary>Gets the root directory information from the path contained in the specified character span.</summary>
13951403
<returns>A character span containing the root directory of `path`.</returns>
1396-
<remarks>To be added.</remarks>
1404+
<remarks>
1405+
<format type="text/markdown"><![CDATA[
1406+
1407+
## Remarks
1408+
1409+
Unlike the string overload, this method doesn't normalize directory separators.
1410+
1411+
]]></format>
1412+
</remarks>
13971413
<related type="article" href="~/docs/standard/io/file-path-formats.md">File path formats on Windows systems</related>
13981414
</Docs>
13991415
</Member>
@@ -1983,7 +1999,15 @@ There is a difference between a fully qualified path (as indicated by the `IsPat
19831999
<summary>Returns a value that indicates whether the specified file path is fixed to a specific drive or UNC path.</summary>
19842000
<returns>
19852001
<see langword="true" /> if the path is fixed to a specific drive or UNC path; <see langword="false" /> if the path is relative to the current drive or working directory.</returns>
1986-
<remarks>To be added.</remarks>
2002+
<remarks>
2003+
<format type="text/markdown"><![CDATA[
2004+
2005+
## Remarks
2006+
2007+
This method handles paths that use the alternate directory separator. It's a frequent mistake to assume that rooted paths (<xref:System.IO.Path.IsPathRooted(System.String)>) aren't relative. For example, "C:a" is drive relative, that is, it's resolved against the current directory for C: (rooted, but relative). "C:\a" is rooted and not relative, that is, the current directory isn't used to modify the path.
2008+
2009+
]]></format>
2010+
</remarks>
19872011
<exception cref="T:System.ArgumentNullException">
19882012
<paramref name="path" /> is <see langword="null" />.</exception>
19892013
<related type="article" href="~/docs/standard/io/file-path-formats.md">File path formats on Windows systems</related>
@@ -2580,8 +2604,8 @@ Not all invalid characters for directory and file names are interpreted as unacc
25802604
</Parameters>
25812605
<Docs>
25822606
<param name="path">To be added.</param>
2583-
<summary>To be added.</summary>
2584-
<returns>To be added.</returns>
2607+
<summary>Trims one trailing directory separator beyond the root of the specified path.</summary>
2608+
<returns>The <paramref name="path" /> without any trailing directory separators.</returns>
25852609
<remarks>To be added.</remarks>
25862610
</Docs>
25872611
</Member>
@@ -2611,8 +2635,8 @@ Not all invalid characters for directory and file names are interpreted as unacc
26112635
</Parameters>
26122636
<Docs>
26132637
<param name="path">To be added.</param>
2614-
<summary>To be added.</summary>
2615-
<returns>To be added.</returns>
2638+
<summary>Trims one trailing directory separator beyond the root of the specified path.</summary>
2639+
<returns>The <paramref name="path" /> without any trailing directory separators.</returns>
26162640
<remarks>To be added.</remarks>
26172641
</Docs>
26182642
</Member>
@@ -2785,4 +2809,4 @@ The destination character span must be large enough to hold the concatenated pat
27852809
</Docs>
27862810
</Member>
27872811
</Members>
2788-
</Type>
2812+
</Type>

xml/System.IO/TextWriter.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2445,7 +2445,15 @@ This method is equivalent to `Write(stringBuilder.ToString())`, but it uses the
24452445
<param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" />.</param>
24462446
<summary>Asynchronously writes a string builder to the text stream.</summary>
24472447
<returns>A task that represents the asynchronous write operation.</returns>
2448-
<remarks>To be added.</remarks>
2448+
<remarks>
2449+
<format type="text/markdown"><![CDATA[
2450+
2451+
## Remarks
2452+
2453+
This method is equivalent to calling `WriteAsync(stringBuilder.ToString())`, however, it uses the <xref:System.Text.StringBuilder.GetChunks?displayProperty=nameWithType> method to avoid creating the intermediate string.
2454+
2455+
]]></format>
2456+
</remarks>
24492457
</Docs>
24502458
</Member>
24512459
<Member MemberName="WriteAsync">

xml/System.IO/UnmanagedMemoryStream.xml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -711,9 +711,7 @@
711711
</Parameters>
712712
<Docs>
713713
<param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" />.</param>
714-
<summary>Overrides the <see cref="M:System.IO.Stream.FlushAsync(System.Threading.CancellationToken)" /> method so that the operation is cancelled if specified, but no other action is performed.
715-
716-
Available starting in .NET Framework 4.6</summary>
714+
<summary>Overrides the <see cref="M:System.IO.Stream.FlushAsync(System.Threading.CancellationToken)" /> method so that the operation is cancelled if specified, but no other action is performed.</summary>
717715
<returns>A task that represents the asynchronous flush operation.</returns>
718716
<remarks>
719717
<format type="text/markdown"><![CDATA[
@@ -786,12 +784,13 @@
786784
<param name="access">One of the <see cref="T:System.IO.FileAccess" /> values.</param>
787785
<summary>Initializes a new instance of the <see cref="T:System.IO.UnmanagedMemoryStream" /> class by using a pointer to an unmanaged memory location.</summary>
788786
<remarks>
789-
<format type="text/markdown"><![CDATA[
790-
787+
<format type="text/markdown"><![CDATA[
788+
791789
## Remarks
792-
This method is equivalent to the <xref:System.IO.UnmanagedMemoryStream.%23ctor%2A> constructor. It supports methods that need to initialize the pointer before setting stream variables and, therefore, cannot call the parameterized constructor. Such methods should use the parameterless constructor, <xref:System.IO.UnmanagedMemoryStream.%23ctor>, initialize the pointer, and then invoke the <xref:System.IO.UnmanagedMemoryStream.Initialize%2A> method.
793-
794-
]]></format>
790+
791+
This method is equivalent to the <xref:System.IO.UnmanagedMemoryStream.%23ctor%2A> constructor. It supports methods that need to initialize the pointer before setting stream variables and, therefore, cannot call the parameterized constructor. Such methods should use the parameterless constructor, <xref:System.IO.UnmanagedMemoryStream.%23ctor>, initialize the pointer, and then invoke the <xref:System.IO.UnmanagedMemoryStream.Initialize%2A> method.
792+
793+
]]></format>
795794
</remarks>
796795
<exception cref="T:System.Security.SecurityException">The user does not have the required permission.</exception>
797796
<exception cref="T:System.ArgumentNullException">The <paramref name="pointer" /> value is <see langword="null" />.</exception>
@@ -1576,7 +1575,15 @@
15761575
<param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" />.</param>
15771576
<summary>Asynchronously writes a span of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.</summary>
15781577
<returns>A task that represents the asynchronous write operation.</returns>
1579-
<remarks>To be added.</remarks>
1578+
<remarks>
1579+
<format type="text/markdown"><![CDATA[
1580+
1581+
## Remarks
1582+
1583+
If an exception occurs during the write operation, it will be set as the <xref:System.Threading.Tasks.Task.Exception%2A?displayProperty=nameWithType> of the property of the returned task.
1584+
1585+
]]></format>
1586+
</remarks>
15801587
</Docs>
15811588
</Member>
15821589
<Member MemberName="WriteAsync">

0 commit comments

Comments
 (0)