You've already forked linux-packaging-mono
Imported Upstream version 5.14.0.78
Former-commit-id: 3494343bcc9ddb42b36b82dd9ae7b69e85e0229f
This commit is contained in:
parent
74b74abd9f
commit
19234507ba
12
mcs/class/corlib/corefx/AwaitTaskContinuation.cs
Normal file
12
mcs/class/corlib/corefx/AwaitTaskContinuation.cs
Normal file
@ -0,0 +1,12 @@
|
||||
namespace System.Threading.Tasks
|
||||
{
|
||||
partial class AwaitTaskContinuation
|
||||
{
|
||||
public void MarkAborted (ThreadAbortException e) {}
|
||||
}
|
||||
|
||||
partial class CompletionActionInvoker
|
||||
{
|
||||
public void MarkAborted (ThreadAbortException e) {}
|
||||
}
|
||||
}
|
149
mcs/class/corlib/corefx/CompareInfo.cs
Normal file
149
mcs/class/corlib/corefx/CompareInfo.cs
Normal file
@ -0,0 +1,149 @@
|
||||
//
|
||||
// CompareInfo.cs
|
||||
//
|
||||
// Authors:
|
||||
// Marek Safar <marek.safar@gmail.com>
|
||||
//
|
||||
// Copyright (C) 2018 Microsoft Corporation
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Globalization
|
||||
{
|
||||
partial class CompareInfo
|
||||
{
|
||||
void InitSort (CultureInfo culture)
|
||||
{
|
||||
_sortName = culture.SortName;
|
||||
}
|
||||
|
||||
unsafe static int CompareStringOrdinalIgnoreCase (char* pString1, int length1, char* pString2, int length2)
|
||||
{
|
||||
var ti = CultureInfo.InvariantCulture.TextInfo;
|
||||
|
||||
int index = 0;
|
||||
while (index < length1 && index < length2 && ti.ToUpper (*pString1) == ti.ToUpper (*pString2)) {
|
||||
++index;
|
||||
++pString1;
|
||||
++pString2;
|
||||
}
|
||||
|
||||
if (index >= length1) {
|
||||
if (index >= length2)
|
||||
return 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (index >= length2)
|
||||
return 1;
|
||||
|
||||
return ti.ToUpper (*pString1) - ti.ToUpper (*pString2);
|
||||
}
|
||||
|
||||
internal static int IndexOfOrdinalCore (string source, string value, int startIndex, int count, bool ignoreCase)
|
||||
{
|
||||
if (!ignoreCase)
|
||||
return source.IndexOfUnchecked (value, startIndex, count);
|
||||
|
||||
return source.IndexOfUncheckedIgnoreCase (value, startIndex, count);
|
||||
}
|
||||
|
||||
internal static unsafe int LastIndexOfOrdinalCore (string source, string value, int startIndex, int count, bool ignoreCase)
|
||||
{
|
||||
if (!ignoreCase)
|
||||
return source.LastIndexOfUnchecked (value, startIndex, count);
|
||||
|
||||
return source.LastIndexOfUncheckedIgnoreCase (value, startIndex, count);
|
||||
}
|
||||
|
||||
int LastIndexOfCore (string source, string target, int startIndex, int count, CompareOptions options)
|
||||
{
|
||||
return internal_index_switch (source, startIndex, count, target, options, false);
|
||||
}
|
||||
|
||||
unsafe int IndexOfCore (string source, string target, int startIndex, int count, CompareOptions options, int* matchLengthPtr)
|
||||
{
|
||||
if (matchLengthPtr != null)
|
||||
throw new NotImplementedException ();
|
||||
|
||||
return internal_index_switch (source, startIndex, count, target, options, true);
|
||||
}
|
||||
|
||||
int CompareString (ReadOnlySpan<char> string1, string string2, CompareOptions options)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
int CompareString (ReadOnlySpan<char> string1, ReadOnlySpan<char> string2, CompareOptions options)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
unsafe static bool IsSortable (char *text, int length)
|
||||
{
|
||||
return Mono.Globalization.Unicode.MSCompatUnicodeTable.IsSortable (new string (text, 0, length));
|
||||
}
|
||||
|
||||
SortKey CreateSortKey (String source, CompareOptions options)
|
||||
{
|
||||
if (source == null)
|
||||
throw new ArgumentNullException (nameof (source));
|
||||
|
||||
if ((options & ValidSortkeyCtorMaskOffFlags) != 0)
|
||||
throw new ArgumentException (SR.Argument_InvalidFlag, nameof (options));
|
||||
|
||||
return CreateSortKeyCore (source, options);
|
||||
}
|
||||
|
||||
bool StartsWith (string source, string prefix, CompareOptions options)
|
||||
{
|
||||
if (UseManagedCollation)
|
||||
return GetCollator ().IsPrefix (source, prefix, options);
|
||||
|
||||
if (source.Length < prefix.Length)
|
||||
return false;
|
||||
|
||||
return Compare (source, 0, prefix.Length, prefix, 0, prefix.Length, options) == 0;
|
||||
}
|
||||
|
||||
bool EndsWith (string source, string suffix, CompareOptions options)
|
||||
{
|
||||
if (UseManagedCollation)
|
||||
return GetCollator ().IsSuffix (source, suffix, options);
|
||||
|
||||
if (source.Length < suffix.Length)
|
||||
return false;
|
||||
|
||||
return Compare (source, source.Length - suffix.Length, suffix.Length, suffix, 0, suffix.Length, options) == 0;
|
||||
}
|
||||
|
||||
internal int GetHashCodeOfStringCore (string source, CompareOptions options)
|
||||
{
|
||||
return GetSortKey (source, options).GetHashCode ();
|
||||
}
|
||||
|
||||
SortVersion GetSortVersion ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
7
mcs/class/corlib/corefx/GlobalizationMode.cs
Normal file
7
mcs/class/corlib/corefx/GlobalizationMode.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace System.Globalization
|
||||
{
|
||||
partial class GlobalizationMode
|
||||
{
|
||||
private static bool GetGlobalizationInvariantMode () => false;
|
||||
}
|
||||
}
|
15
mcs/class/corlib/corefx/MemoryExtensions.cs
Normal file
15
mcs/class/corlib/corefx/MemoryExtensions.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace System
|
||||
{
|
||||
partial class MemoryExtensions
|
||||
{
|
||||
public static ReadOnlySpan<char> AsSpan (this string text)
|
||||
{
|
||||
if (text == null)
|
||||
return default;
|
||||
|
||||
return new ReadOnlySpan<char> (Unsafe.As<Pinnable<char>> (text), StringAdjustment, text.Length);
|
||||
}
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
9ac00eca4c5e8b4a2e61d5826df2437d0ceb119b
|
||||
ec5b4344a30b08f8137db41ec67c1b34702c56b8
|
7
mcs/class/corlib/corefx/SynchronizationContext.cs
Normal file
7
mcs/class/corlib/corefx/SynchronizationContext.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace System.Threading
|
||||
{
|
||||
partial class SynchronizationContext
|
||||
{
|
||||
internal static SynchronizationContext CurrentExplicit => Current;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user