add all
This commit is contained in:
73
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/Platform.cs
vendored
Normal file
73
Packages/com.tivadar.best.http/Runtime/3rdParty/BouncyCastle/util/Platform.cs
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
#pragma warning disable
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Best.HTTP.SecureProtocol.Org.BouncyCastle.Utilities
|
||||
{
|
||||
internal static class Platform
|
||||
{
|
||||
private static readonly CompareInfo InvariantCompareInfo = CultureInfo.InvariantCulture.CompareInfo;
|
||||
|
||||
internal static bool EqualsIgnoreCase(string a, string b)
|
||||
{
|
||||
return string.Equals(a, b, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
internal static string GetEnvironmentVariable(string variable)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Environment.GetEnvironmentVariable(variable);
|
||||
}
|
||||
catch (System.Security.SecurityException)
|
||||
{
|
||||
// We don't have the required permission to read this environment variable,
|
||||
// which is fine, just act as if it's not set
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
internal static int IndexOf(string source, char value)
|
||||
{
|
||||
return InvariantCompareInfo.IndexOf(source, value, CompareOptions.Ordinal);
|
||||
}
|
||||
|
||||
internal static int IndexOf(string source, string value)
|
||||
{
|
||||
return InvariantCompareInfo.IndexOf(source, value, CompareOptions.Ordinal);
|
||||
}
|
||||
|
||||
internal static int IndexOf(string source, char value, int startIndex)
|
||||
{
|
||||
return InvariantCompareInfo.IndexOf(source, value, startIndex, CompareOptions.Ordinal);
|
||||
}
|
||||
|
||||
internal static int IndexOf(string source, string value, int startIndex)
|
||||
{
|
||||
return InvariantCompareInfo.IndexOf(source, value, startIndex, CompareOptions.Ordinal);
|
||||
}
|
||||
|
||||
internal static int LastIndexOf(string source, string value)
|
||||
{
|
||||
return InvariantCompareInfo.LastIndexOf(source, value, CompareOptions.Ordinal);
|
||||
}
|
||||
|
||||
internal static bool StartsWith(string source, string prefix)
|
||||
{
|
||||
return InvariantCompareInfo.IsPrefix(source, prefix, CompareOptions.Ordinal);
|
||||
}
|
||||
|
||||
internal static bool EndsWith(string source, string suffix)
|
||||
{
|
||||
return InvariantCompareInfo.IsSuffix(source, suffix, CompareOptions.Ordinal);
|
||||
}
|
||||
|
||||
internal static string GetTypeName(object obj)
|
||||
{
|
||||
return obj.GetType().FullName;
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endif
|
||||
Reference in New Issue
Block a user