C# Class HyoutaTools.Util

显示文件 Open project: AdmiralCurtiss/HyoutaTools

Public Methods

Method Description
Align ( this Number, int Alignment ) : int
Align ( this Number, int Alignment ) : long
Align ( this Number, uint Alignment ) : uint
Align ( this Number, uint Alignment ) : ulong
AsSigned ( this Number ) : int
AsSigned ( this Number ) : long
AsSigned ( this Number ) : sbyte
AsSigned ( this Number ) : short
Assert ( bool cond ) : void
CopyByteArrayPart ( IList from, int locationFrom, IList to, int locationTo, int count ) : void
CopyStream ( System input, System output, int count ) : void
DateTimeToUnixTime ( System.DateTime time ) : ulong
DiscardBytes ( this s, uint count ) : void
FillNull ( IList Array, int Location, int Count ) : void
FromEndian ( this x, Endianness endian ) : Int16
FromEndian ( this x, Endianness endian ) : Int32
FromEndian ( this x, Endianness endian ) : System.Int64
FromEndian ( this x, Endianness endian ) : UInt16
FromEndian ( this x, Endianness endian ) : UInt32
FromEndian ( this x, Endianness endian ) : System.UInt64
GetBytesForUInt24 ( uint Number ) : byte[]
GetHexVal ( char hex ) : int
GetTextAscii ( byte File, int Pointer ) : String
GetTextShiftJis ( byte File, int Pointer ) : String
GetTextUTF8 ( byte File, int Pointer ) : String
GetTextUTF8 ( byte File, int Pointer, int &NullLocation ) : String
GetTextUnicode ( byte File, int Pointer, int MaxByteLength ) : String
GuessFileExtension ( Stream s ) : string
HexStringToByteArray ( string hex ) : byte[]
IsByteArrayPartEqual ( IList Array1, int Location1, IList Array2, int Location2, int count ) : bool
IsIdentical ( this str, Stream other, long count ) : bool
Like ( this str, string pattern ) : bool

Compares the string against a given pattern.

PS3TimeToDateTime ( ulong PS3Time ) : DateTime
ParseDecOrHex ( string s ) : uint
ParseDecOrHexToByte ( string s ) : byte
PeekByte ( this s ) : byte
PeekUInt16 ( this s ) : ushort
PeekUInt24 ( this s ) : uint
PeekUInt32 ( this s ) : uint
PeekUInt40 ( this s ) : ulong
PeekUInt48 ( this s ) : ulong
PeekUInt56 ( this s ) : ulong
PeekUInt64 ( this s ) : ulong
ReadAlign ( this s, long alignment ) : void
ReadAscii ( this s, int count ) : string
ReadAsciiNullterm ( this s ) : string
ReadAsciiNulltermFromLocationAndReset ( this s, long location ) : string
ReadShiftJisNullterm ( this s ) : string
ReadUInt16 ( this s ) : ushort
ReadUInt24 ( this s ) : uint
ReadUInt32 ( this s ) : uint
ReadUInt40 ( this s ) : ulong
ReadUInt48 ( this s ) : ulong
ReadUInt56 ( this s ) : ulong
ReadUInt64 ( this s ) : ulong
ReadUTF16Nullterm ( this s ) : string
ReadUTF8Nullterm ( this s ) : string
RunProgram ( String prog, String args, bool displayCommandLine, bool displayOutput, bool useShell = false ) : bool
StringToBytesShiftJis ( String s ) : byte[]
StringToBytesUTF16 ( String s ) : byte[]
SwapEndian ( this x ) : Int16
SwapEndian ( this x ) : Int32
SwapEndian ( this x ) : Int64
SwapEndian ( this x ) : UInt16
SwapEndian ( this x ) : UInt32
SwapEndian ( this x ) : UInt64
SwapEndian4Bits ( this x ) : byte
ToEndian ( this x, Endianness endian ) : Int16
ToEndian ( this x, Endianness endian ) : Int32
ToEndian ( this x, Endianness endian ) : Int64
ToEndian ( this x, Endianness endian ) : UInt16
ToEndian ( this x, Endianness endian ) : UInt32
ToEndian ( this x, Endianness endian ) : UInt64
ToUInt24 ( byte File, int Pointer ) : uint
TrimNull ( this s ) : String
Truncate ( this value, int maxLength ) : string
UIntToFloat ( this integer ) : float

converts a 32-bit int that's actually a byte representation of a float to an actual float for use in calculations or whatever

UnEscape ( this s ) : string
UnixTimeToDateTime ( ulong unixTime ) : DateTime
Write ( this s, byte data ) : void
WriteAlign ( this s, long alignment, byte paddingByte ) : void
WriteAscii ( this s, string str, int count, bool trim = false ) : void
WriteString ( this s, Encoding encoding, string str, int count, bool trim = false ) : void
WriteUInt16 ( this s, ushort num ) : void
WriteUInt32 ( this s, uint num ) : void
WriteUInt64 ( this s, ulong num ) : void
WriteUTF8 ( this s, string str, int count, bool trim = false ) : void
WriteUTF8Nullterm ( this s, string str ) : void
XmlEscape ( string s ) : string

Method Details

Align() public static method

public static Align ( this Number, int Alignment ) : int
Number this
Alignment int
return int

Align() public static method

public static Align ( this Number, int Alignment ) : long
Number this
Alignment int
return long

Align() public static method

public static Align ( this Number, uint Alignment ) : uint
Number this
Alignment uint
return uint

Align() public static method

public static Align ( this Number, uint Alignment ) : ulong
Number this
Alignment uint
return ulong

AsSigned() public static method

public static AsSigned ( this Number ) : int
Number this
return int

AsSigned() public static method

public static AsSigned ( this Number ) : long
Number this
return long

AsSigned() public static method

public static AsSigned ( this Number ) : sbyte
Number this
return sbyte

AsSigned() public static method

public static AsSigned ( this Number ) : short
Number this
return short

Assert() public static method

public static Assert ( bool cond ) : void
cond bool
return void

CopyByteArrayPart() public static method

public static CopyByteArrayPart ( IList from, int locationFrom, IList to, int locationTo, int count ) : void
from IList
locationFrom int
to IList
locationTo int
count int
return void

CopyStream() public static method

public static CopyStream ( System input, System output, int count ) : void
input System
output System
count int
return void

DateTimeToUnixTime() public static method

public static DateTimeToUnixTime ( System.DateTime time ) : ulong
time System.DateTime
return ulong

DiscardBytes() public static method

public static DiscardBytes ( this s, uint count ) : void
s this
count uint
return void

FillNull() public static method

public static FillNull ( IList Array, int Location, int Count ) : void
Array IList
Location int
Count int
return void

FromEndian() public static method

public static FromEndian ( this x, Endianness endian ) : Int16
x this
endian Endianness
return System.Int16

FromEndian() public static method

public static FromEndian ( this x, Endianness endian ) : Int32
x this
endian Endianness
return System.Int32

FromEndian() public static method

public static FromEndian ( this x, Endianness endian ) : System.Int64
x this
endian Endianness
return System.Int64

FromEndian() public static method

public static FromEndian ( this x, Endianness endian ) : UInt16
x this
endian Endianness
return System.UInt16

FromEndian() public static method

public static FromEndian ( this x, Endianness endian ) : UInt32
x this
endian Endianness
return System.UInt32

FromEndian() public static method

public static FromEndian ( this x, Endianness endian ) : System.UInt64
x this
endian Endianness
return System.UInt64

GetBytesForUInt24() public static method

public static GetBytesForUInt24 ( uint Number ) : byte[]
Number uint
return byte[]

GetHexVal() public static method

public static GetHexVal ( char hex ) : int
hex char
return int

GetTextAscii() public static method

public static GetTextAscii ( byte File, int Pointer ) : String
File byte
Pointer int
return String

GetTextShiftJis() public static method

public static GetTextShiftJis ( byte File, int Pointer ) : String
File byte
Pointer int
return String

GetTextUTF8() public static method

public static GetTextUTF8 ( byte File, int Pointer ) : String
File byte
Pointer int
return String

GetTextUTF8() public static method

public static GetTextUTF8 ( byte File, int Pointer, int &NullLocation ) : String
File byte
Pointer int
NullLocation int
return String

GetTextUnicode() public static method

public static GetTextUnicode ( byte File, int Pointer, int MaxByteLength ) : String
File byte
Pointer int
MaxByteLength int
return String

GuessFileExtension() public static method

public static GuessFileExtension ( Stream s ) : string
s Stream
return string

HexStringToByteArray() public static method

public static HexStringToByteArray ( string hex ) : byte[]
hex string
return byte[]

IsByteArrayPartEqual() public static method

public static IsByteArrayPartEqual ( IList Array1, int Location1, IList Array2, int Location2, int count ) : bool
Array1 IList
Location1 int
Array2 IList
Location2 int
count int
return bool

IsIdentical() public static method

public static IsIdentical ( this str, Stream other, long count ) : bool
str this
other Stream
count long
return bool

Like() public static method

Compares the string against a given pattern.
public static Like ( this str, string pattern ) : bool
str this The string.
pattern string The pattern to match, where "*" means any sequence of characters, and "?" means any single character.
return bool

PS3TimeToDateTime() public static method

public static PS3TimeToDateTime ( ulong PS3Time ) : DateTime
PS3Time ulong
return DateTime

ParseDecOrHex() public static method

public static ParseDecOrHex ( string s ) : uint
s string
return uint

ParseDecOrHexToByte() public static method

public static ParseDecOrHexToByte ( string s ) : byte
s string
return byte

PeekByte() public static method

public static PeekByte ( this s ) : byte
s this
return byte

PeekUInt16() public static method

public static PeekUInt16 ( this s ) : ushort
s this
return ushort

PeekUInt24() public static method

public static PeekUInt24 ( this s ) : uint
s this
return uint

PeekUInt32() public static method

public static PeekUInt32 ( this s ) : uint
s this
return uint

PeekUInt40() public static method

public static PeekUInt40 ( this s ) : ulong
s this
return ulong

PeekUInt48() public static method

public static PeekUInt48 ( this s ) : ulong
s this
return ulong

PeekUInt56() public static method

public static PeekUInt56 ( this s ) : ulong
s this
return ulong

PeekUInt64() public static method

public static PeekUInt64 ( this s ) : ulong
s this
return ulong

ReadAlign() public static method

public static ReadAlign ( this s, long alignment ) : void
s this
alignment long
return void

ReadAscii() public static method

public static ReadAscii ( this s, int count ) : string
s this
count int
return string

ReadAsciiNullterm() public static method

public static ReadAsciiNullterm ( this s ) : string
s this
return string

ReadAsciiNulltermFromLocationAndReset() public static method

public static ReadAsciiNulltermFromLocationAndReset ( this s, long location ) : string
s this
location long
return string

ReadShiftJisNullterm() public static method

public static ReadShiftJisNullterm ( this s ) : string
s this
return string

ReadUInt16() public static method

public static ReadUInt16 ( this s ) : ushort
s this
return ushort

ReadUInt24() public static method

public static ReadUInt24 ( this s ) : uint
s this
return uint

ReadUInt32() public static method

public static ReadUInt32 ( this s ) : uint
s this
return uint

ReadUInt40() public static method

public static ReadUInt40 ( this s ) : ulong
s this
return ulong

ReadUInt48() public static method

public static ReadUInt48 ( this s ) : ulong
s this
return ulong

ReadUInt56() public static method

public static ReadUInt56 ( this s ) : ulong
s this
return ulong

ReadUInt64() public static method

public static ReadUInt64 ( this s ) : ulong
s this
return ulong

ReadUTF16Nullterm() public static method

public static ReadUTF16Nullterm ( this s ) : string
s this
return string

ReadUTF8Nullterm() public static method

public static ReadUTF8Nullterm ( this s ) : string
s this
return string

RunProgram() public static method

public static RunProgram ( String prog, String args, bool displayCommandLine, bool displayOutput, bool useShell = false ) : bool
prog String
args String
displayCommandLine bool
displayOutput bool
useShell bool
return bool

StringToBytesShiftJis() public static method

public static StringToBytesShiftJis ( String s ) : byte[]
s String
return byte[]

StringToBytesUTF16() public static method

public static StringToBytesUTF16 ( String s ) : byte[]
s String
return byte[]

SwapEndian() public static method

public static SwapEndian ( this x ) : Int16
x this
return Int16

SwapEndian() public static method

public static SwapEndian ( this x ) : Int32
x this
return Int32

SwapEndian() public static method

public static SwapEndian ( this x ) : Int64
x this
return Int64

SwapEndian() public static method

public static SwapEndian ( this x ) : UInt16
x this
return UInt16

SwapEndian() public static method

public static SwapEndian ( this x ) : UInt32
x this
return UInt32

SwapEndian() public static method

public static SwapEndian ( this x ) : UInt64
x this
return UInt64

SwapEndian4Bits() public static method

public static SwapEndian4Bits ( this x ) : byte
x this
return byte

ToEndian() public static method

public static ToEndian ( this x, Endianness endian ) : Int16
x this
endian Endianness
return Int16

ToEndian() public static method

public static ToEndian ( this x, Endianness endian ) : Int32
x this
endian Endianness
return Int32

ToEndian() public static method

public static ToEndian ( this x, Endianness endian ) : Int64
x this
endian Endianness
return Int64

ToEndian() public static method

public static ToEndian ( this x, Endianness endian ) : UInt16
x this
endian Endianness
return UInt16

ToEndian() public static method

public static ToEndian ( this x, Endianness endian ) : UInt32
x this
endian Endianness
return UInt32

ToEndian() public static method

public static ToEndian ( this x, Endianness endian ) : UInt64
x this
endian Endianness
return UInt64

ToUInt24() public static method

public static ToUInt24 ( byte File, int Pointer ) : uint
File byte
Pointer int
return uint

TrimNull() public static method

public static TrimNull ( this s ) : String
s this
return String

Truncate() public static method

public static Truncate ( this value, int maxLength ) : string
value this
maxLength int
return string

UIntToFloat() public static method

converts a 32-bit int that's actually a byte representation of a float to an actual float for use in calculations or whatever
public static UIntToFloat ( this integer ) : float
integer this
return float

UnEscape() public static method

public static UnEscape ( this s ) : string
s this
return string

UnixTimeToDateTime() public static method

public static UnixTimeToDateTime ( ulong unixTime ) : DateTime
unixTime ulong
return DateTime

Write() public static method

public static Write ( this s, byte data ) : void
s this
data byte
return void

WriteAlign() public static method

public static WriteAlign ( this s, long alignment, byte paddingByte ) : void
s this
alignment long
paddingByte byte
return void

WriteAscii() public static method

public static WriteAscii ( this s, string str, int count, bool trim = false ) : void
s this
str string
count int
trim bool
return void

WriteString() public static method

public static WriteString ( this s, Encoding encoding, string str, int count, bool trim = false ) : void
s this
encoding Encoding
str string
count int
trim bool
return void

WriteUInt16() public static method

public static WriteUInt16 ( this s, ushort num ) : void
s this
num ushort
return void

WriteUInt32() public static method

public static WriteUInt32 ( this s, uint num ) : void
s this
num uint
return void

WriteUInt64() public static method

public static WriteUInt64 ( this s, ulong num ) : void
s this
num ulong
return void

WriteUTF8() public static method

public static WriteUTF8 ( this s, string str, int count, bool trim = false ) : void
s this
str string
count int
trim bool
return void

WriteUTF8Nullterm() public static method

public static WriteUTF8Nullterm ( this s, string str ) : void
s this
str string
return void

XmlEscape() public static method

public static XmlEscape ( string s ) : string
s string
return string