mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Blind update of zip code to newest RVWorld version
This commit is contained in:
43
SabreTools.Library/External/Compress/Utils/Reporter.cs
vendored
Normal file
43
SabreTools.Library/External/Compress/Utils/Reporter.cs
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
|
||||
namespace Compress.Utils
|
||||
{
|
||||
public static class Reporter
|
||||
{
|
||||
public static string ToArrayString(this ulong[] arr)
|
||||
{
|
||||
if (arr == null)
|
||||
return "NULL";
|
||||
|
||||
string ret = $"({arr.Length}) " + arr[0].ToString();
|
||||
for (int i = 1; i < arr.Length; i++)
|
||||
{
|
||||
ret += "," + arr[i].ToString();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
public static string ToArrayString(this byte[] arr)
|
||||
{
|
||||
if (arr == null)
|
||||
return "NULL";
|
||||
|
||||
string ret = $"({arr.Length}) " + arr[0].ToString("X2");
|
||||
for (int i = 1; i < arr.Length; i++)
|
||||
{
|
||||
ret += "," + arr[i].ToString("X2");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
public static string ToHex(this uint? v)
|
||||
{
|
||||
return v == null ? "NULL" : ((uint)v).ToString("X8");
|
||||
}
|
||||
public static string ToHex(this ulong? v)
|
||||
{
|
||||
return v == null ? "NULL" : ((ulong)v).ToString("X8");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user