up
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
|
||||
#if UNITY_WSA && !UNITY_EDITOR && !ENABLE_IL2CPP
|
||||
using System.TypeFix;
|
||||
#endif
|
||||
|
||||
namespace Org.BouncyCastle.Utilities.Collections
|
||||
{
|
||||
public abstract class CollectionUtilities
|
||||
{
|
||||
public static void AddRange(IList to, IEnumerable range)
|
||||
{
|
||||
foreach (object o in range)
|
||||
{
|
||||
to.Add(o);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CheckElementsAreOfType(IEnumerable e, Type t)
|
||||
{
|
||||
foreach (object o in e)
|
||||
{
|
||||
if (!t.IsInstanceOfType(o))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static IDictionary ReadOnly(IDictionary d)
|
||||
{
|
||||
return d;
|
||||
}
|
||||
|
||||
public static IList ReadOnly(IList l)
|
||||
{
|
||||
return l;
|
||||
}
|
||||
|
||||
public static ISet ReadOnly(ISet s)
|
||||
{
|
||||
return s;
|
||||
}
|
||||
|
||||
public static string ToString(IEnumerable c)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder("[");
|
||||
|
||||
IEnumerator e = c.GetEnumerator();
|
||||
|
||||
if (e.MoveNext())
|
||||
{
|
||||
sb.Append(e.Current.ToString());
|
||||
|
||||
while (e.MoveNext())
|
||||
{
|
||||
sb.Append(", ");
|
||||
sb.Append(e.Current.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
sb.Append(']');
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f89525335a7d41dca3d8a03528ca51a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,48 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Org.BouncyCastle.Utilities.Collections
|
||||
{
|
||||
public sealed class EmptyEnumerable
|
||||
: IEnumerable
|
||||
{
|
||||
public static readonly IEnumerable Instance = new EmptyEnumerable();
|
||||
|
||||
private EmptyEnumerable()
|
||||
{
|
||||
}
|
||||
|
||||
public IEnumerator GetEnumerator()
|
||||
{
|
||||
return EmptyEnumerator.Instance;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class EmptyEnumerator
|
||||
: IEnumerator
|
||||
{
|
||||
public static readonly IEnumerator Instance = new EmptyEnumerator();
|
||||
|
||||
private EmptyEnumerator()
|
||||
{
|
||||
}
|
||||
|
||||
public bool MoveNext()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
}
|
||||
|
||||
public object Current
|
||||
{
|
||||
get { throw new InvalidOperationException("No elements"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95162a21e2545413b8877d592f59a4ae
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Org.BouncyCastle.Utilities.Collections
|
||||
{
|
||||
public sealed class EnumerableProxy
|
||||
: IEnumerable
|
||||
{
|
||||
private readonly IEnumerable inner;
|
||||
|
||||
public EnumerableProxy(
|
||||
IEnumerable inner)
|
||||
{
|
||||
if (inner == null)
|
||||
throw new ArgumentNullException("inner");
|
||||
|
||||
this.inner = inner;
|
||||
}
|
||||
|
||||
public IEnumerator GetEnumerator()
|
||||
{
|
||||
return inner.GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ac20b40f93ab47dda46ecdf0c329641
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
103
Assets/BestHTTP/SecureProtocol/util/collections/HashSet.cs
Normal file
103
Assets/BestHTTP/SecureProtocol/util/collections/HashSet.cs
Normal file
@@ -0,0 +1,103 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Org.BouncyCastle.Utilities.Collections
|
||||
{
|
||||
public class HashSet
|
||||
: ISet
|
||||
{
|
||||
private readonly IDictionary impl = Platform.CreateHashtable();
|
||||
|
||||
public HashSet()
|
||||
{
|
||||
}
|
||||
|
||||
public HashSet(IEnumerable s)
|
||||
{
|
||||
foreach (object o in s)
|
||||
{
|
||||
Add(o);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Add(object o)
|
||||
{
|
||||
impl[o] = null;
|
||||
}
|
||||
|
||||
public virtual void AddAll(IEnumerable e)
|
||||
{
|
||||
foreach (object o in e)
|
||||
{
|
||||
Add(o);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Clear()
|
||||
{
|
||||
impl.Clear();
|
||||
}
|
||||
|
||||
public virtual bool Contains(object o)
|
||||
{
|
||||
return impl.Contains(o);
|
||||
}
|
||||
|
||||
public virtual void CopyTo(Array array, int index)
|
||||
{
|
||||
impl.Keys.CopyTo(array, index);
|
||||
}
|
||||
|
||||
public virtual int Count
|
||||
{
|
||||
get { return impl.Count; }
|
||||
}
|
||||
|
||||
public virtual IEnumerator GetEnumerator()
|
||||
{
|
||||
return impl.Keys.GetEnumerator();
|
||||
}
|
||||
|
||||
public virtual bool IsEmpty
|
||||
{
|
||||
get { return impl.Count == 0; }
|
||||
}
|
||||
|
||||
public virtual bool IsFixedSize
|
||||
{
|
||||
get { return impl.IsFixedSize; }
|
||||
}
|
||||
|
||||
public virtual bool IsReadOnly
|
||||
{
|
||||
get { return impl.IsReadOnly; }
|
||||
}
|
||||
|
||||
public virtual bool IsSynchronized
|
||||
{
|
||||
get { return impl.IsSynchronized; }
|
||||
}
|
||||
|
||||
public virtual void Remove(object o)
|
||||
{
|
||||
impl.Remove(o);
|
||||
}
|
||||
|
||||
public virtual void RemoveAll(IEnumerable e)
|
||||
{
|
||||
foreach (object o in e)
|
||||
{
|
||||
Remove(o);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual object SyncRoot
|
||||
{
|
||||
get { return impl.SyncRoot; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5defe029d74f94c6ca3e70f23c3eccdd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
23
Assets/BestHTTP/SecureProtocol/util/collections/ISet.cs
Normal file
23
Assets/BestHTTP/SecureProtocol/util/collections/ISet.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Org.BouncyCastle.Utilities.Collections
|
||||
{
|
||||
public interface ISet
|
||||
: ICollection
|
||||
{
|
||||
void Add(object o);
|
||||
void AddAll(IEnumerable e);
|
||||
void Clear();
|
||||
bool Contains(object o);
|
||||
bool IsEmpty { get; }
|
||||
bool IsFixedSize { get; }
|
||||
bool IsReadOnly { get; }
|
||||
void Remove(object o);
|
||||
void RemoveAll(IEnumerable e);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
11
Assets/BestHTTP/SecureProtocol/util/collections/ISet.cs.meta
Normal file
11
Assets/BestHTTP/SecureProtocol/util/collections/ISet.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fbaa9bcce0f34877862d630b422fbea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user