C# 클래스 CqlSharp.TypeExtensions

DateTime extensions to convert date-time values to and from unix-time
파일 보기 프로젝트 열기: reuzel/CqlSharp

공개 프로퍼티들

프로퍼티 타입 설명
Epoch System.DateTime

공개 메소드들

메소드 설명
DecodeHex ( this hex ) : string

Decodes the hexadecimal string into its normal form.

EncodeAsHex ( this value, string prefix = "" ) : string

Returns a hex string representation of an array of bytes.

From: http://blogs.msdn.com/b/blambert/archive/2009/02/22/blambert-codesnip-fast-byte-array-to-hex-string-conversion.aspx

IsAnonymous ( this type ) : bool

Determines whether the specified type is anonymous.

ToBytes ( this datetime, byte array, int offset ) : void

Writes the datetime as a unix timestamp to the provided array

ToDateTime ( this timestamp ) : System.DateTime

Translates a unix/POSIX timestamp to a DateTime

ToGuid ( this bytes, int offset ) : System.Guid

converts the array to a Guid value

ToHex ( this value, string prefix = "" ) : string

Returns a hex string representation of an array of bytes.

From: http://blogs.msdn.com/b/blambert/archive/2009/02/22/blambert-codesnip-fast-byte-array-to-hex-string-conversion.aspx

ToInt ( this bytes, int offset ) : int

converts the array into a int value (big-endian)

ToLong ( this bytes, int offset ) : long

converts the array into a long value (big-endian)

ToShort ( this bytes, int offset ) : ushort

converts the array into a unsigned short value (big-endian)

ToTimestamp ( this datetime ) : long

Translates the DateTime to a unix/POSIX timestamp

비공개 메소드들

메소드 설명
GetHexVal ( char hex ) : int

메소드 상세

DecodeHex() 공개 정적인 메소드

Decodes the hexadecimal string into its normal form.
Error parsing hexadecimal string. A hex string must have an even number of digits.
public static DecodeHex ( this hex ) : string
hex this The hexadecimal string.
리턴 string

EncodeAsHex() 공개 정적인 메소드

Returns a hex string representation of an array of bytes.
From: http://blogs.msdn.com/b/blambert/archive/2009/02/22/blambert-codesnip-fast-byte-array-to-hex-string-conversion.aspx
public static EncodeAsHex ( this value, string prefix = "" ) : string
value this The array of bytes.
prefix string string value to prefix hex string with (e.g. 0x)
리턴 string

IsAnonymous() 공개 정적인 메소드

Determines whether the specified type is anonymous.
public static IsAnonymous ( this type ) : bool
type this The type.
리턴 bool

ToBytes() 공개 정적인 메소드

Writes the datetime as a unix timestamp to the provided array
public static ToBytes ( this datetime, byte array, int offset ) : void
datetime this The datetime.
array byte The array.
offset int The offset.
리턴 void

ToDateTime() 공개 정적인 메소드

Translates a unix/POSIX timestamp to a DateTime
public static ToDateTime ( this timestamp ) : System.DateTime
timestamp this The timestamp.
리턴 System.DateTime

ToGuid() 공개 정적인 메소드

converts the array to a Guid value
public static ToGuid ( this bytes, int offset ) : System.Guid
bytes this The bytes.
offset int The offset.
리턴 System.Guid

ToHex() 공개 정적인 메소드

Returns a hex string representation of an array of bytes.
From: http://blogs.msdn.com/b/blambert/archive/2009/02/22/blambert-codesnip-fast-byte-array-to-hex-string-conversion.aspx
public static ToHex ( this value, string prefix = "" ) : string
value this The array of bytes.
prefix string string value to prefix hex string with (e.g. 0x)
리턴 string

ToInt() 공개 정적인 메소드

converts the array into a int value (big-endian)
public static ToInt ( this bytes, int offset ) : int
bytes this The bytes.
offset int The offset.
리턴 int

ToLong() 공개 정적인 메소드

converts the array into a long value (big-endian)
public static ToLong ( this bytes, int offset ) : long
bytes this The bytes.
offset int The offset.
리턴 long

ToShort() 공개 정적인 메소드

converts the array into a unsigned short value (big-endian)
public static ToShort ( this bytes, int offset ) : ushort
bytes this The bytes.
offset int The offset.
리턴 ushort

ToTimestamp() 공개 정적인 메소드

Translates the DateTime to a unix/POSIX timestamp
public static ToTimestamp ( this datetime ) : long
datetime this The datetime.
리턴 long

프로퍼티 상세

Epoch 공개적으로 정적으로 프로퍼티

public static DateTime,System Epoch
리턴 System.DateTime