C# Class FoundationDB.Layers.Tuples.FdbTupleParser

Helper class that contains low-level encoders for the tuple binary format
ファイルを表示 Open project: BedeGaming/foundationdb-dotnet-client Class Usage Examples

Public Methods

Method Description
MostSignificantBit ( uint v ) : int

Returns the position of the most significant bit (0-based) in a 32-bit integer

NumberOfBytes ( long v ) : int

Returns the minimum number of bytes needed to represent a value

Note: will return 1 even for == 0

NumberOfBytes ( uint v ) : int

Returns the minimum number of bytes needed to represent a value

Note: will return 1 even for == 0

NumberOfBytes ( ulong v ) : int

Returns the minimum number of bytes needed to represent a value

ParseNext ( SliceReader &reader ) : Slice

Decode the next token from a packed tuple

WriteBytes ( FoundationDB.Client.SliceWriter &writer, ArraySegment value ) : void

Writes a binary string

WriteBytes ( FoundationDB.Client.SliceWriter &writer, [ value, int offset, int count ) : void

Writes a binary string

WriteBytes ( FoundationDB.Client.SliceWriter &writer, byte value ) : void

Writes a binary string

WriteChar ( FoundationDB.Client.SliceWriter &writer, char value ) : void

Writes a char encoded in UTF-8

WriteDouble ( FoundationDB.Client.SliceWriter &writer, double value ) : void

Writes an Double at the end, and advance the cursor

WriteGuid ( FoundationDB.Client.SliceWriter &writer, System.Guid value ) : void

Writes a RFC 4122 encoded 16-byte Microsoft GUID

WriteInt32 ( FoundationDB.Client.SliceWriter &writer, int value ) : void

Writes an Int32 at the end, and advance the cursor

WriteInt64 ( FoundationDB.Client.SliceWriter &writer, long value ) : void

Writes an Int64 at the end, and advance the cursor

WriteInt8 ( FoundationDB.Client.SliceWriter &writer, byte value ) : void

Writes an UInt8 at the end, and advance the cursor

WriteNil ( FoundationDB.Client.SliceWriter &writer ) : void

Writes a null value at the end, and advance the cursor

WriteSingle ( FoundationDB.Client.SliceWriter &writer, float value ) : void

Writes an Single at the end, and advance the cursor

WriteString ( FoundationDB.Client.SliceWriter &writer, string value ) : void

Writes a string encoded in UTF-8

WriteUInt32 ( FoundationDB.Client.SliceWriter &writer, uint value ) : void

Writes an UInt32 at the end, and advance the cursor

WriteUInt64 ( FoundationDB.Client.SliceWriter &writer, ulong value ) : void

Writes an UInt64 at the end, and advance the cursor

WriteUuid128 ( FoundationDB.Client.SliceWriter &writer, Uuid128 value ) : void

Writes a RFC 4122 encoded 128-bit UUID

WriteUuid64 ( FoundationDB.Client.SliceWriter &writer, Uuid64 value ) : void

Writes a 64-bit UUID

Private Methods

Method Description
ParseAscii ( Slice slice ) : string
ParseBytes ( Slice slice ) : Slice
ParseDouble ( Slice slice ) : double
ParseGuid ( Slice slice ) : System.Guid
ParseInt64 ( int type, Slice slice ) : long
ParseSingle ( Slice slice ) : float
ParseUnicode ( Slice slice ) : string
ParseUuid128 ( Slice slice ) : Uuid128
ParseUuid64 ( Slice slice ) : Uuid64
TryWriteUnescapedUtf8String ( FoundationDB.Client.SliceWriter &writer, char chars, int count ) : bool
UnescapeByteString ( [ buffer, int offset, int count ) : ArraySegment
UnescapeByteStringSlow ( [ buffer, int offset, int count, int offsetOfFirstZero ) : ArraySegment
WriteChars ( FoundationDB.Client.SliceWriter &writer, char value, int offset, int count ) : void

Writes a char array encoded in UTF-8

WriteInt64Slow ( FoundationDB.Client.SliceWriter &writer, long value ) : void
WriteNulEscapedBytes ( FoundationDB.Client.SliceWriter &writer, byte type, [ value ) : void

Writes a buffer with all instances of 0 escaped as '00 FF'

WriteNulEscapedBytes ( FoundationDB.Client.SliceWriter &writer, byte type, [ value, int offset, int count ) : void

Writes a buffer with all instances of 0 escaped as '00 FF'

WriteUInt64Slow ( FoundationDB.Client.SliceWriter &writer, ulong value ) : void
WriteUnescapedAsciiChars ( FoundationDB.Client.SliceWriter &writer, char chars, int count ) : void

Method Details

MostSignificantBit() public static method

Returns the position of the most significant bit (0-based) in a 32-bit integer
public static MostSignificantBit ( uint v ) : int
v uint 32-bit integer
return int

NumberOfBytes() public static method

Returns the minimum number of bytes needed to represent a value
Note: will return 1 even for == 0
public static NumberOfBytes ( long v ) : int
v long
return int

NumberOfBytes() public static method

Returns the minimum number of bytes needed to represent a value
Note: will return 1 even for == 0
public static NumberOfBytes ( uint v ) : int
v uint
return int

NumberOfBytes() public static method

Returns the minimum number of bytes needed to represent a value
public static NumberOfBytes ( ulong v ) : int
v ulong
return int

ParseNext() public static method

Decode the next token from a packed tuple
public static ParseNext ( SliceReader &reader ) : Slice
reader FoundationDB.Client.SliceReader Parser from wich to read the next token
return Slice

WriteBytes() public static method

Writes a binary string
public static WriteBytes ( FoundationDB.Client.SliceWriter &writer, ArraySegment value ) : void
writer FoundationDB.Client.SliceWriter
value ArraySegment
return void

WriteBytes() public static method

Writes a binary string
public static WriteBytes ( FoundationDB.Client.SliceWriter &writer, [ value, int offset, int count ) : void
writer FoundationDB.Client.SliceWriter
value [
offset int
count int
return void

WriteBytes() public static method

Writes a binary string
public static WriteBytes ( FoundationDB.Client.SliceWriter &writer, byte value ) : void
writer FoundationDB.Client.SliceWriter
value byte
return void

WriteChar() public static method

Writes a char encoded in UTF-8
public static WriteChar ( FoundationDB.Client.SliceWriter &writer, char value ) : void
writer FoundationDB.Client.SliceWriter
value char
return void

WriteDouble() public static method

Writes an Double at the end, and advance the cursor
public static WriteDouble ( FoundationDB.Client.SliceWriter &writer, double value ) : void
writer FoundationDB.Client.SliceWriter Target buffer
value double IEEE Floating point, 64 bits, High Endian
return void

WriteGuid() public static method

Writes a RFC 4122 encoded 16-byte Microsoft GUID
public static WriteGuid ( FoundationDB.Client.SliceWriter &writer, System.Guid value ) : void
writer FoundationDB.Client.SliceWriter
value System.Guid
return void

WriteInt32() public static method

Writes an Int32 at the end, and advance the cursor
public static WriteInt32 ( FoundationDB.Client.SliceWriter &writer, int value ) : void
writer FoundationDB.Client.SliceWriter Target buffer
value int Signed DWORD, 32 bits, High Endian
return void

WriteInt64() public static method

Writes an Int64 at the end, and advance the cursor
public static WriteInt64 ( FoundationDB.Client.SliceWriter &writer, long value ) : void
writer FoundationDB.Client.SliceWriter Target buffer
value long Signed QWORD, 64 bits, High Endian
return void

WriteInt8() public static method

Writes an UInt8 at the end, and advance the cursor
public static WriteInt8 ( FoundationDB.Client.SliceWriter &writer, byte value ) : void
writer FoundationDB.Client.SliceWriter Target buffer
value byte Unsigned BYTE, 32 bits
return void

WriteNil() public static method

Writes a null value at the end, and advance the cursor
public static WriteNil ( FoundationDB.Client.SliceWriter &writer ) : void
writer FoundationDB.Client.SliceWriter
return void

WriteSingle() public static method

Writes an Single at the end, and advance the cursor
public static WriteSingle ( FoundationDB.Client.SliceWriter &writer, float value ) : void
writer FoundationDB.Client.SliceWriter Target buffer
value float IEEE Floating point, 32 bits, High Endian
return void

WriteString() public static method

Writes a string encoded in UTF-8
public static WriteString ( FoundationDB.Client.SliceWriter &writer, string value ) : void
writer FoundationDB.Client.SliceWriter
value string
return void

WriteUInt32() public static method

Writes an UInt32 at the end, and advance the cursor
public static WriteUInt32 ( FoundationDB.Client.SliceWriter &writer, uint value ) : void
writer FoundationDB.Client.SliceWriter Target buffer
value uint Signed DWORD, 32 bits, High Endian
return void

WriteUInt64() public static method

Writes an UInt64 at the end, and advance the cursor
public static WriteUInt64 ( FoundationDB.Client.SliceWriter &writer, ulong value ) : void
writer FoundationDB.Client.SliceWriter Target buffer
value ulong Signed QWORD, 64 bits, High Endian
return void

WriteUuid128() public static method

Writes a RFC 4122 encoded 128-bit UUID
public static WriteUuid128 ( FoundationDB.Client.SliceWriter &writer, Uuid128 value ) : void
writer FoundationDB.Client.SliceWriter
value Uuid128
return void

WriteUuid64() public static method

Writes a 64-bit UUID
public static WriteUuid64 ( FoundationDB.Client.SliceWriter &writer, Uuid64 value ) : void
writer FoundationDB.Client.SliceWriter
value Uuid64
return void