mirror of
https://github.com/SabreTools/SabreTools.IO.git
synced 2026-02-04 05:36:05 +00:00
Add base type operator support to both-endian
This commit is contained in:
@@ -14,6 +14,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothInt16 operator +(BothInt16 a, short b)
|
||||
{
|
||||
short le = (short)(a.LittleEndian + b);
|
||||
short be = (short)(a.BigEndian + b);
|
||||
return new BothInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothInt16 operator -(BothInt16 a, BothInt16 b)
|
||||
{
|
||||
short le = (short)(a.LittleEndian - b.LittleEndian);
|
||||
@@ -21,6 +28,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothInt16 operator -(BothInt16 a, short b)
|
||||
{
|
||||
short le = (short)(a.LittleEndian - b);
|
||||
short be = (short)(a.BigEndian - b);
|
||||
return new BothInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothInt16 operator *(BothInt16 a, BothInt16 b)
|
||||
{
|
||||
short le = (short)(a.LittleEndian * b.LittleEndian);
|
||||
@@ -28,6 +42,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothInt16 operator *(BothInt16 a, short b)
|
||||
{
|
||||
short le = (short)(a.LittleEndian * b);
|
||||
short be = (short)(a.BigEndian * b);
|
||||
return new BothInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothInt16 operator /(BothInt16 a, BothInt16 b)
|
||||
{
|
||||
short le = (short)(a.LittleEndian / b.LittleEndian);
|
||||
@@ -35,6 +56,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothInt16 operator /(BothInt16 a, short b)
|
||||
{
|
||||
short le = (short)(a.LittleEndian / b);
|
||||
short be = (short)(a.BigEndian / b);
|
||||
return new BothInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothInt16 operator ^(BothInt16 a, BothInt16 b)
|
||||
{
|
||||
short le = (short)(a.LittleEndian ^ b.LittleEndian);
|
||||
@@ -42,6 +70,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothInt16 operator ^(BothInt16 a, short b)
|
||||
{
|
||||
short le = (short)(a.LittleEndian ^ b);
|
||||
short be = (short)(a.BigEndian ^ b);
|
||||
return new BothInt16(le, be);
|
||||
}
|
||||
|
||||
public static implicit operator BothInt16(short val)
|
||||
=> new(val, val);
|
||||
|
||||
|
||||
@@ -14,6 +14,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothInt32 operator +(BothInt32 a, int b)
|
||||
{
|
||||
int le = (int)(a.LittleEndian + b);
|
||||
int be = (int)(a.BigEndian + b);
|
||||
return new BothInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothInt32 operator -(BothInt32 a, BothInt32 b)
|
||||
{
|
||||
int le = (int)(a.LittleEndian - b.LittleEndian);
|
||||
@@ -21,6 +28,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothInt32 operator -(BothInt32 a, int b)
|
||||
{
|
||||
int le = (int)(a.LittleEndian - b);
|
||||
int be = (int)(a.BigEndian - b);
|
||||
return new BothInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothInt32 operator *(BothInt32 a, BothInt32 b)
|
||||
{
|
||||
int le = (int)(a.LittleEndian * b.LittleEndian);
|
||||
@@ -28,6 +42,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothInt32 operator *(BothInt32 a, int b)
|
||||
{
|
||||
int le = (int)(a.LittleEndian * b);
|
||||
int be = (int)(a.BigEndian * b);
|
||||
return new BothInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothInt32 operator /(BothInt32 a, BothInt32 b)
|
||||
{
|
||||
int le = (int)(a.LittleEndian / b.LittleEndian);
|
||||
@@ -35,6 +56,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothInt32 operator /(BothInt32 a, int b)
|
||||
{
|
||||
int le = (int)(a.LittleEndian / b);
|
||||
int be = (int)(a.BigEndian / b);
|
||||
return new BothInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothInt32 operator ^(BothInt32 a, BothInt32 b)
|
||||
{
|
||||
int le = (int)(a.LittleEndian ^ b.LittleEndian);
|
||||
@@ -42,6 +70,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothInt32 operator ^(BothInt32 a, int b)
|
||||
{
|
||||
int le = (int)(a.LittleEndian ^ b);
|
||||
int be = (int)(a.BigEndian ^ b);
|
||||
return new BothInt32(le, be);
|
||||
}
|
||||
|
||||
public static implicit operator BothInt32(int val)
|
||||
=> new(val, val);
|
||||
|
||||
|
||||
@@ -14,6 +14,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothInt64 operator +(BothInt64 a, long b)
|
||||
{
|
||||
long le = (long)(a.LittleEndian + b);
|
||||
long be = (long)(a.BigEndian + b);
|
||||
return new BothInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothInt64 operator -(BothInt64 a, BothInt64 b)
|
||||
{
|
||||
long le = (long)(a.LittleEndian - b.LittleEndian);
|
||||
@@ -21,6 +28,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothInt64 operator -(BothInt64 a, long b)
|
||||
{
|
||||
long le = (long)(a.LittleEndian - b);
|
||||
long be = (long)(a.BigEndian - b);
|
||||
return new BothInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothInt64 operator *(BothInt64 a, BothInt64 b)
|
||||
{
|
||||
long le = (long)(a.LittleEndian * b.LittleEndian);
|
||||
@@ -28,6 +42,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothInt64 operator *(BothInt64 a, long b)
|
||||
{
|
||||
long le = (long)(a.LittleEndian * b);
|
||||
long be = (long)(a.BigEndian * b);
|
||||
return new BothInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothInt64 operator /(BothInt64 a, BothInt64 b)
|
||||
{
|
||||
long le = (long)(a.LittleEndian / b.LittleEndian);
|
||||
@@ -35,6 +56,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothInt64 operator /(BothInt64 a, long b)
|
||||
{
|
||||
long le = (long)(a.LittleEndian / b);
|
||||
long be = (long)(a.BigEndian / b);
|
||||
return new BothInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothInt64 operator ^(BothInt64 a, BothInt64 b)
|
||||
{
|
||||
long le = (long)(a.LittleEndian ^ b.LittleEndian);
|
||||
@@ -42,6 +70,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothInt64 operator ^(BothInt64 a, long b)
|
||||
{
|
||||
long le = (long)(a.LittleEndian ^ b);
|
||||
long be = (long)(a.BigEndian ^ b);
|
||||
return new BothInt64(le, be);
|
||||
}
|
||||
|
||||
public static implicit operator BothInt64(long val)
|
||||
=> new(val, val);
|
||||
|
||||
|
||||
@@ -14,6 +14,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothInt8 operator +(BothInt8 a, sbyte b)
|
||||
{
|
||||
sbyte le = (sbyte)(a.LittleEndian + b);
|
||||
sbyte be = (sbyte)(a.BigEndian + b);
|
||||
return new BothInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothInt8 operator -(BothInt8 a, BothInt8 b)
|
||||
{
|
||||
sbyte le = (sbyte)(a.LittleEndian - b.LittleEndian);
|
||||
@@ -21,6 +28,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothInt8 operator -(BothInt8 a, sbyte b)
|
||||
{
|
||||
sbyte le = (sbyte)(a.LittleEndian - b);
|
||||
sbyte be = (sbyte)(a.BigEndian - b);
|
||||
return new BothInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothInt8 operator *(BothInt8 a, BothInt8 b)
|
||||
{
|
||||
sbyte le = (sbyte)(a.LittleEndian * b.LittleEndian);
|
||||
@@ -28,6 +42,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothInt8 operator *(BothInt8 a, sbyte b)
|
||||
{
|
||||
sbyte le = (sbyte)(a.LittleEndian * b);
|
||||
sbyte be = (sbyte)(a.BigEndian * b);
|
||||
return new BothInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothInt8 operator /(BothInt8 a, BothInt8 b)
|
||||
{
|
||||
sbyte le = (sbyte)(a.LittleEndian / b.LittleEndian);
|
||||
@@ -35,6 +56,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothInt8 operator /(BothInt8 a, sbyte b)
|
||||
{
|
||||
sbyte le = (sbyte)(a.LittleEndian / b);
|
||||
sbyte be = (sbyte)(a.BigEndian / b);
|
||||
return new BothInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothInt8 operator ^(BothInt8 a, BothInt8 b)
|
||||
{
|
||||
sbyte le = (sbyte)(a.LittleEndian ^ b.LittleEndian);
|
||||
@@ -42,6 +70,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothInt8 operator ^(BothInt8 a, sbyte b)
|
||||
{
|
||||
sbyte le = (sbyte)(a.LittleEndian ^ b);
|
||||
sbyte be = (sbyte)(a.BigEndian ^ b);
|
||||
return new BothInt8(le, be);
|
||||
}
|
||||
|
||||
public static implicit operator BothInt8(sbyte val)
|
||||
=> new(val, val);
|
||||
|
||||
|
||||
@@ -14,6 +14,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt16 operator +(BothUInt16 a, ushort b)
|
||||
{
|
||||
ushort le = (ushort)(a.LittleEndian + b);
|
||||
ushort be = (ushort)(a.BigEndian + b);
|
||||
return new BothUInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt16 operator -(BothUInt16 a, BothUInt16 b)
|
||||
{
|
||||
ushort le = (ushort)(a.LittleEndian - b.LittleEndian);
|
||||
@@ -21,6 +28,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt16 operator -(BothUInt16 a, ushort b)
|
||||
{
|
||||
ushort le = (ushort)(a.LittleEndian - b);
|
||||
ushort be = (ushort)(a.BigEndian - b);
|
||||
return new BothUInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt16 operator *(BothUInt16 a, BothUInt16 b)
|
||||
{
|
||||
ushort le = (ushort)(a.LittleEndian * b.LittleEndian);
|
||||
@@ -28,6 +42,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt16 operator *(BothUInt16 a, ushort b)
|
||||
{
|
||||
ushort le = (ushort)(a.LittleEndian * b);
|
||||
ushort be = (ushort)(a.BigEndian * b);
|
||||
return new BothUInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt16 operator /(BothUInt16 a, BothUInt16 b)
|
||||
{
|
||||
ushort le = (ushort)(a.LittleEndian / b.LittleEndian);
|
||||
@@ -35,6 +56,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt16 operator /(BothUInt16 a, ushort b)
|
||||
{
|
||||
ushort le = (ushort)(a.LittleEndian / b);
|
||||
ushort be = (ushort)(a.BigEndian / b);
|
||||
return new BothUInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt16 operator ^(BothUInt16 a, BothUInt16 b)
|
||||
{
|
||||
ushort le = (ushort)(a.LittleEndian ^ b.LittleEndian);
|
||||
@@ -42,6 +70,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt16(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt16 operator ^(BothUInt16 a, ushort b)
|
||||
{
|
||||
ushort le = (ushort)(a.LittleEndian ^ b);
|
||||
ushort be = (ushort)(a.BigEndian ^ b);
|
||||
return new BothUInt16(le, be);
|
||||
}
|
||||
|
||||
public static implicit operator BothUInt16(ushort val)
|
||||
=> new(val, val);
|
||||
|
||||
|
||||
@@ -14,6 +14,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt32 operator +(BothUInt32 a, uint b)
|
||||
{
|
||||
uint le = (uint)(a.LittleEndian + b);
|
||||
uint be = (uint)(a.BigEndian + b);
|
||||
return new BothUInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt32 operator -(BothUInt32 a, BothUInt32 b)
|
||||
{
|
||||
uint le = (uint)(a.LittleEndian - b.LittleEndian);
|
||||
@@ -21,6 +28,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt32 operator -(BothUInt32 a, uint b)
|
||||
{
|
||||
uint le = (uint)(a.LittleEndian - b);
|
||||
uint be = (uint)(a.BigEndian - b);
|
||||
return new BothUInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt32 operator *(BothUInt32 a, BothUInt32 b)
|
||||
{
|
||||
uint le = (uint)(a.LittleEndian * b.LittleEndian);
|
||||
@@ -28,6 +42,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt32 operator *(BothUInt32 a, uint b)
|
||||
{
|
||||
uint le = (uint)(a.LittleEndian * b);
|
||||
uint be = (uint)(a.BigEndian * b);
|
||||
return new BothUInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt32 operator /(BothUInt32 a, BothUInt32 b)
|
||||
{
|
||||
uint le = (uint)(a.LittleEndian / b.LittleEndian);
|
||||
@@ -35,10 +56,24 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt32 operator /(BothUInt32 a, uint b)
|
||||
{
|
||||
uint le = (uint)(a.LittleEndian / b);
|
||||
uint be = (uint)(a.BigEndian / b);
|
||||
return new BothUInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt32 operator ^(BothUInt32 a, BothUInt32 b)
|
||||
{
|
||||
uint le = (uint)(a.LittleEndian ^ b.LittleEndian);
|
||||
uint be = (uint)(a.BigEndian ^ b.BigEndian);
|
||||
uint le = (uint)(a.LittleEndian ^ b);
|
||||
uint be = (uint)(a.BigEndian ^ b);
|
||||
return new BothUInt32(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt32 operator ^(BothUInt32 a, uint b)
|
||||
{
|
||||
uint le = (uint)(a.LittleEndian ^ b);
|
||||
uint be = (uint)(a.BigEndian ^ b);
|
||||
return new BothUInt32(le, be);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt64 operator +(BothUInt64 a, ulong b)
|
||||
{
|
||||
ulong le = (ulong)(a.LittleEndian + b);
|
||||
ulong be = (ulong)(a.BigEndian + b);
|
||||
return new BothUInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt64 operator -(BothUInt64 a, BothUInt64 b)
|
||||
{
|
||||
ulong le = (ulong)(a.LittleEndian - b.LittleEndian);
|
||||
@@ -21,6 +28,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt64 operator -(BothUInt64 a, ulong b)
|
||||
{
|
||||
ulong le = (ulong)(a.LittleEndian - b);
|
||||
ulong be = (ulong)(a.BigEndian - b);
|
||||
return new BothUInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt64 operator *(BothUInt64 a, BothUInt64 b)
|
||||
{
|
||||
ulong le = (ulong)(a.LittleEndian * b.LittleEndian);
|
||||
@@ -28,6 +42,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt64 operator *(BothUInt64 a, ulong b)
|
||||
{
|
||||
ulong le = (ulong)(a.LittleEndian * b);
|
||||
ulong be = (ulong)(a.BigEndian * b);
|
||||
return new BothUInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt64 operator /(BothUInt64 a, BothUInt64 b)
|
||||
{
|
||||
ulong le = (ulong)(a.LittleEndian / b.LittleEndian);
|
||||
@@ -35,6 +56,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt64 operator /(BothUInt64 a, ulong b)
|
||||
{
|
||||
ulong le = (ulong)(a.LittleEndian / b);
|
||||
ulong be = (ulong)(a.BigEndian / b);
|
||||
return new BothUInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt64 operator ^(BothUInt64 a, BothUInt64 b)
|
||||
{
|
||||
ulong le = (ulong)(a.LittleEndian ^ b.LittleEndian);
|
||||
@@ -42,6 +70,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt64(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt64 operator ^(BothUInt64 a, ulong b)
|
||||
{
|
||||
ulong le = (ulong)(a.LittleEndian ^ b);
|
||||
ulong be = (ulong)(a.BigEndian ^ b);
|
||||
return new BothUInt64(le, be);
|
||||
}
|
||||
|
||||
public static implicit operator BothUInt64(ulong val)
|
||||
=> new(val, val);
|
||||
|
||||
|
||||
@@ -14,6 +14,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt8 operator +(BothUInt8 a, byte b)
|
||||
{
|
||||
byte le = (byte)(a.LittleEndian + b);
|
||||
byte be = (byte)(a.BigEndian + b);
|
||||
return new BothUInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt8 operator -(BothUInt8 a, BothUInt8 b)
|
||||
{
|
||||
byte le = (byte)(a.LittleEndian - b.LittleEndian);
|
||||
@@ -21,6 +28,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt8 operator -(BothUInt8 a, byte b)
|
||||
{
|
||||
byte le = (byte)(a.LittleEndian - b);
|
||||
byte be = (byte)(a.BigEndian - b);
|
||||
return new BothUInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt8 operator *(BothUInt8 a, BothUInt8 b)
|
||||
{
|
||||
byte le = (byte)(a.LittleEndian * b.LittleEndian);
|
||||
@@ -28,6 +42,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt8 operator *(BothUInt8 a, byte b)
|
||||
{
|
||||
byte le = (byte)(a.LittleEndian * b);
|
||||
byte be = (byte)(a.BigEndian * b);
|
||||
return new BothUInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt8 operator /(BothUInt8 a, BothUInt8 b)
|
||||
{
|
||||
byte le = (byte)(a.LittleEndian / b.LittleEndian);
|
||||
@@ -35,6 +56,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt8 operator /(BothUInt8 a, byte b)
|
||||
{
|
||||
byte le = (byte)(a.LittleEndian / b);
|
||||
byte be = (byte)(a.BigEndian / b);
|
||||
return new BothUInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt8 operator ^(BothUInt8 a, BothUInt8 b)
|
||||
{
|
||||
byte le = (byte)(a.LittleEndian ^ b.LittleEndian);
|
||||
@@ -42,6 +70,13 @@ namespace SabreTools.IO.Numerics
|
||||
return new BothUInt8(le, be);
|
||||
}
|
||||
|
||||
public static BothUInt8 operator ^(BothUInt8 a, byte b)
|
||||
{
|
||||
byte le = (byte)(a.LittleEndian ^ b);
|
||||
byte be = (byte)(a.BigEndian ^ b);
|
||||
return new BothUInt8(le, be);
|
||||
}
|
||||
|
||||
public static implicit operator BothUInt8(byte val)
|
||||
=> new(val, val);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user