dproto.serialize

Serialization/deserialization code

Members

Functions

defaultDecode
void defaultDecode(ulong header, ref R data)

Removes bytes from the range as if it were read in

fromVarint
T fromVarint(R src)

Decode a VarInt-encoded series of bytes into an unsigned value

fromVarint
T fromVarint(R src)

Decode a VarInt-encoded series of bytes into a signed value

fromZigZag
Signed!T fromZigZag(T src)

Decodes a number from its zigzag encoding

isBuiltinType
bool isBuiltinType(string type)

Returns whether the given string is a protocol buffer primitive

msgNum
ulong msgNum(ulong data)

Get the message number from the encoding value

msgType
auto msgType(string T)

Maps the given type string to the wire type number

readProto
BuffType!T readProto(auto ref R src)
BuffType!T readProto(auto ref R src)
BuffType!T readProto(auto ref R src)

Decode a series of bytes into a value

readVarint
T readVarint(auto ref R src)

Read a VarInt-encoded value from a data stream

toVarint
void toVarint(ref R r, T src)

Encode an unsigned value into a VarInt-encoded series of bytes

toVarint
void toVarint(ref R r, long src)

Encode a signed value into a VarInt-encoded series of bytes

toZigZag
Unsigned!T toZigZag(T src)

Encodes a number in its zigzag encoding

wireType
ubyte wireType(ulong data)

Get the wire type from the encoding value

writeProto
void writeProto(ref R r, BuffType!T src)
void writeProto(ref R r, BuffType!T src)
void writeProto(ref R r, const BuffType!T src)

Encode a value into a series of bytes

Manifest constants

ENUM_SERIALIZATION
enum ENUM_SERIALIZATION;

The type to encode an enum as

PACKED_MSG_TYPE
enum PACKED_MSG_TYPE;

The message type to encode a packed message as

Structs

CntRange
struct CntRange

Simple range that ignores data but counts the length

Templates

BuffType
template BuffType(string T)

Maps the given type string to the data type it represents

Meta

Authors

Matthew Soucy, dproto@msoucy.me