Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Moves String.Comparison.cs to shared location
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-safar committed Mar 20, 2018
1 parent a0562b4 commit ab94f87
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/mscorlib/System.Private.CoreLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@
<Compile Include="$(BclSourcesRoot)\System\Array.cs" />
<Compile Include="$(BclSourcesRoot)\System\ThrowHelper.cs" />
<Compile Include="$(BclSourcesRoot)\System\String.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\String.Comparison.cs" />
<Compile Include="$(BclSourcesRoot)\System\Text\StringBuilder.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Text\StringBuilderCache.cs" />
<Compile Include="$(BclSourcesRoot)\System\Exception.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\SpanHelpers.Byte.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\SpanHelpers.T.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\String.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\String.Comparison.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\String.Manipulation.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\String.Searching.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\StackOverflowException.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ namespace System
{
public partial class String
{
//
//Native Static Methods
//

private static unsafe int CompareOrdinalIgnoreCaseHelper(String strA, String strB)
{
Debug.Assert(strA != null);
Expand Down Expand Up @@ -61,21 +57,6 @@ private static unsafe int CompareOrdinalIgnoreCaseHelper(String strA, String str
}
}

// native call to COMString::CompareOrdinalEx
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern int CompareOrdinalHelper(String strA, int indexA, int countA, String strB, int indexB, int countB);

//This will not work in case-insensitive mode for any character greater than 0x7F.
//We'll throw an ArgumentException.
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern unsafe int nativeCompareOrdinalIgnoreCaseWC(String strA, sbyte* strBBytes);

//
//
// NATIVE INSTANCE METHODS
//
//

//
// Search/Query methods
//
Expand Down
9 changes: 9 additions & 0 deletions src/mscorlib/src/System/String.CoreCLR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ public extern int Length
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern bool IsAscii();

// native call to COMString::CompareOrdinalEx
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern int CompareOrdinalHelper(String strA, int indexA, int countA, String strB, int indexB, int countB);

//This will not work in case-insensitive mode for any character greater than 0x7F.
//We'll throw an ArgumentException.
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern unsafe int nativeCompareOrdinalIgnoreCaseWC(String strA, sbyte* strBBytes);

#if FEATURE_COMINTEROP
// Set extra byte for odd-sized strings that came from interop as BSTR.
[MethodImplAttribute(MethodImplOptions.InternalCall)]
Expand Down

0 comments on commit ab94f87

Please sign in to comment.