- Added
Json.Deserialize(string, Type?, JsonSerializerSettings?)
andJson.Deserialize(string, Type?)
to provide more deserialization options regarding return type. - Note: This also fixes the return type deficiency in non-generic deserialization methods.
- Changes to the
Json
class documentation to describe in more detail what each method does.
The npm version of the package is no longer supported and is also no longer supported as a Unity3D package.
The NuGet version of the package now supports .NET 6.0
, .NET 8.0
, and .NET Standard 2.1
.
The package has been updated to more robustly handle (nullable types).
- Problem: When the IncludeInterface parameter was true and the method compared an interface and an object that inherited that interface, the result was always false.
- Cause: The issue was due to incorrect usage of the
Type.IsAssignableFrom(Type)
method, which was called from the object type instead of the interface type. - Fix: Now
Type.IsAssignableFrom(Type)
method is called correctly from interface type.
The abstract class ScratchObject
is marked as deprecated starting in .NET 5
and will throw an error starting in .NET 8
.
For more information, visit https://aka.ms/binaryformatter.
Alternative: Use the Json class as an alternative to ScratchObject
.
IndexOutOfRangeException
issue in Type_CB_Extension.GetAttribute<T>(this Type, bool)
method.
The IndexOutOfRangeException
error consisted of the fact that the method did not correctly check the internal variable which is an array, when this array was empty it caused the IndexOutOfRangeException
.
The method that checks whether the first index of the array was null did not take into account whether the array was null and whether it was empty.
New methods like ArrayManipulation.ForSector<T>(Array, in Action<T, long>, in long)
, ArrayManipulation.ForSector<T>(Array, in Action<T, long>)
, ArrayManipulation.ForSector <T>(T[], in Action<T, long>, in long)
, ArrayManipulation.ForSector<T>(T[], in Action<T, long>)
, ArrayManipulation.ForSector<T> (IList, in Action<T, int>, in int)
, ArrayManipulation.ForSector<T>(IList, in Action<T, int>)
, ArrayManipulation.ForSector(IList, in Action<object, int> , in int)
, ArrayManipulation.ForSector(IList, in Action<object, int>)
, ArrayManipulation.ForSector<T>(IList<T>, in Action<T, int>, in int)
and ArrayManipulation.ForSector<T>(IList<T>, in Action<T, int>)
have been added.
The methods ArrayManipulation.ForSector(Array, in Action<object, long>, in long)
and ArrayManipulation.ForSector(Array, in Action<object, long>)
have been added.
Problem checking the index
parameter in the ArrayManipulation.FindIndex<T>(T[], long, long, Predicate<T>)
and ArrayManipulation.FindLastIndex<T>(T[], long, long, Predicate methods <T>)
.
The problem was checking the index
parameter, which was done to check whether it was greater than or equal to zero.
If the array had size zero, the check returned a false positive, generating an ArgumentOutOfRangeException
.
The fix involved checking if the array is zero size before checking the index
parameter.
This problem was present since version 1.4.0
.
Improvements to the ArrayManipulation.SeparateList<T>(T[], long, out T[], out T[])
method.
The ArrayManipulation.SeparateList<T>(T[], long, out T[], out T[])
method has received the following improvements:
- Checks to raise exceptions like
ArgumentNullException
,RankException
andArgumentOutOfRangeException
if they occur. - Returns an empty list in the
out
parameters if the input list is zero.
-
- The metadata files required to work in Unity3D have been added to the package.
-
- The functions
Remove<T>
,Insert<T>
,SeparateList<T>
andTakeStretch<T>
had their parameters of typeint
changed to typelong
.
- The functions
-
- Added
long
type versions to methods that wereint
type versions.
- Added
-
- The functions
T[] Insert<T>(IEnumerator<T>, long, T[])
,T[] Add<T>(IEnumerator<T>, T[])
andAdd<T>( IEnumerator<T>, ref T[])
have been deprecated.
- The functions
-
- The generic collection classes
LongList<T>
, ReadOnlyLongCollection and generic and non-generic interfaces such asILongList
,ILongList<T>
,ILongCollection
,ILongCollection<T>
,IReadOnlyLongCollection<T>
andIReadOnlyLongList<T>
have been added.
- The generic collection classes
The IReadOnlyArray
and IReadOnlyArray<T>
interfaces have been removed using the IReadOnlyLongList
or IReadOnlyList
interface.
The XMLIRWDeclaration
class that represents an xml declaration has been added.
The XMLIRWText
class that represents xml text has been added.
The ITextValue
interface has been added.
The XMLIRWValue
structure has been deprecated and replaced by the XMLIRWText
class. In addition to the XMLIRWValue
structure, functions, properties and constructors that use the XMLIRWValue
structure have become obsolete.
The XML extension has problems reading the xml file.
The constructor of the ICollectionToIEnumerator
class had the ArgumentException
problem due to the fact that the protected field list
is not instantiated.
The TypeUtilitarian
class received a new function called Type TypeUtilitarian.GetType(string fullName)
.
The NuGet package is using C# version 7.3
The NPM package is using version 7.3 of C# in addition to having fixed the problems inherent in the migration to Unity2019.
Package has regressed to netstandard2.0
.
The ReadOnlyIterrupter
class and ALF
classes have been removed.
TaskPool class objects have been added:
public static int Count { get; }
public static int VacantTaskCount { get; }
public static int NonVacantTaskCount { get; }
public static void InitTask(Action action, out Task task);
public static void InitTask(Action action);
public static void InitTask<TRes>(Func<TRes> func, out Task<TRes> res);
public static void InitTask<TRes>(Func<TRes> func);
Objects such as TaskPoolItem
, TaskPoolItem
, TaskPoolItem
, IAsyncTaskWait
, IAsyncTask
, AsyncTaskWait
and AsyncTask
have been removed.
TaskPool class objects have been removed:
public static int PoolCount { get; }
public static int CountTaskCompleted { get; }
public static void AddTask(Action<InternalWait> action);
public static void AddTask(AsyncTaskWait task);
public static void AddTask(AsyncTask task);
public static void AddTask(Action action);
public static void AddTask(Action<InternalWait> action, CancellationToken token);
The method ArrayManipulation.Exists(object?, Array)
has become obsolete the alternative method is ArrayManipulation.Exists<T>(T item, T[] array)
.
The static class PrintOut
has been removed.
//String_CB_Extension extension methods have been added.
public static sbyte ToSByte(this string S, NumberStyles style, IFormatProvider formatProvider);
public static sbyte ToSByte(this string S, IFormatProvider formatProvider);
public static short ToShort(this string S, NumberStyles style, IFormatProvider formatProvider);
public static short ToShort(this string S, IFormatProvider formatProvider);
public static int ToInt(this string S, NumberStyles style, IFormatProvider formatProvider);
public static int ToInt(this string S, IFormatProvider formatProvider);
public static long ToLong(this string S, NumberStyles style, IFormatProvider formatProvider);
public static long ToLong(this string S, IFormatProvider formatProvider);
public static byte ToByte(this string S, NumberStyles style, IFormatProvider formatProvider);
public static byte ToByte(this string S, IFormatProvider formatProvider);
public static ushort ToUShort(this string S, NumberStyles style, IFormatProvider formatProvider);
public static ushort ToUShort(this string S, IFormatProvider formatProvider);
public static uint ToUInt(this string S, NumberStyles style, IFormatProvider formatProvider);
public static uint ToUInt(this string S, IFormatProvider formatProvider);
public static ulong ToULong(this string S, NumberStyles style, IFormatProvider formatProvider);
public static ulong ToULong(this string S, IFormatProvider formatProvider);
public static float ToFloat(this string S, NumberStyles style, IFormatProvider formatProvider);
public static float ToFloat(this string S, IFormatProvider formatProvider);
public static double ToDouble(this string S, NumberStyles style, IFormatProvider formatProvider);
public static double ToDouble(this string S, IFormatProvider formatProvider);
public static decimal ToDecimal(this string S, NumberStyles style, IFormatProvider formatProvider);
public static decimal ToDecimal(this string S, IFormatProvider formatProvider);
//ArrayManipulation class methods have been added.
public static void ClearArray(Array array, int index, int length);
public static void ClearArray<T>(int index, int length, ref T[] array);
public static void ClearArray<T>(ref T[] array);
public static void ClearArraySafe(Array array, int index, int length);
public static void ClearArraySafe<T>(int index, int length, ref T[] array);
public static int LastIndexOf(object? item, Array array, int index, int length);
public static int LastIndexOf(object? item, Array array, int index);
public static int LastIndexOf(object? item, Array array);
public static int FindIndex<T>(T[] array, int index, int length, Predicate<T> match);
public static int FindIndex<T>(T[] array, int index, Predicate<T> match);
public static int FindIndex<T>(T[] array, Predicate<T> match);
public static int FindLastIndex<T>(T[] array, int index, int length, Predicate<T> match);
public static int FindLastIndex<T>(T[] array, int index, Predicate<T> match);
public static int FindLastIndex<T>(T[] array, Predicate<T> match);
public static T FindLast<T>(T[] array, Predicate<T> match);
public static T[] FindAll<T>(T[] array, Predicate<T> match);
public static T Find<T>(T[] array, Predicate<T> match);
public static bool Exists<T>(T[] array, Predicate<T> match);
public static bool Exists<T>(T item, T[] array);
public static void Reverse(Array array, int index, int length);
//The Enum_CB_Extension extension methods have been removed.
public static bool CompareFlag(this Enum E, Enum enum);
public static bool CompareFlag(this Enum E, Enum[] enum);
public static bool ContainsFlag(this Enum E, Enum enum);
public static bool ContainsFlag(this Enum E, Enum[] enum);
The HashString
structure has been added.
//New extension methods for `Stream` have been added.
public static void Write(this Stream F, string text);
public static void Write(this Stream F, char[] chars);
public static char[] GetChars(this Stream F);
public static string GetString(this Stream F);
//Enum_CB_Extension extension methods have been added.
public static bool HasFlag(this Enum E, params Enum[] enum);
public static string Format(this Enum E, object value, string format);
The T[] ArrayManipulation.Empty<T>();
method has been removed.
//The `HashAlgorithm_CB_Extension` extension methods have been removed.
public static bool CompareComprestFileHash(this HashAlgorithm H, string FileName1, string FileName2);
public static bool CompareComprestFileHash(this HashAlgorithm H, FileStream file1, FileStream file2);
public static bool CompareFileHash(this HashAlgorithm H, string FileName1, string FileName2);
public static bool CompareFileHash(this HashAlgorithm H, FileStream file1, FileStream file2);
public static byte[] ComputeHash(this HashAlgorithm H, string FileName);
public static string ComputeHashToString(this HashAlgorithm H, FileStream File);
public static string ComputeHashToString(this HashAlgorithm H, string FileName);
public static string ComputeHashToString(this HashAlgorithm H, byte[] bytes);
public static string ComprestComputehashFileNameToString(this HashAlgorithm H, string FileName);
public static string ComputehashFileNameToString(this HashAlgorithm H, string FileName);
public static byte[] ComputehashFileName(this HashAlgorithm H, string FileName);
public static string ComprestComputehashToString(this HashAlgorithm H, string FileName);
public static string ComprestComputehashToString(this HashAlgorithm H, FileStream File);
public static string ComprestComputehashToString(this HashAlgorithm H, byte[] bytes);
public static string ComputehashDirectoryToString(this HashAlgorithm H, string DirectoryPath);
public static string ComprestComputehashDirectoryToString(this HashAlgorithm H, string DirectoryPath);
public static string ComputehashDirectoryNameToString(this HashAlgorithm H, string DirectoryPath);
public static string ComprestComputehashDirectoryNameToString(this HashAlgorithm H, string DirectoryPath);
public static byte[] ComputehashDirectoryName(this HashAlgorithm H, string DirectoryPath);
public static byte[] ComputehashDirectory(this HashAlgorithm H, string DirectoryPath);
//`HashAlgorithm_CB_Extension` extension methods have been added.
public static byte[] ComputeHash(this HashAlgorithm H, string FilePath);
public static string ComputeHashToString(this HashAlgorithm H, string FilePath);
public static string ComputeHashToString(this HashAlgorithm H, byte[] buffer);
public static string ComputeHashToString(this HashAlgorithm H, byte[] buffer, int offset, int count);
public static string ComputeHashToString(this HashAlgorithm H, Stream inputStream);
The package now has the net472
and netstandard2.1
target frameworks.