dprotobuf.wireformat

This module provides the functions needed to convert to/from the Protocol Buffer binary format.

Members

Enums

WireType
enum WireType

Stores the integer value for each wire type.

Functions

fromByteBlob
T fromByteBlob(ref ubyte[] input)

Fixed sized numeric types.

fromByteString
T[] fromByteString(ref ubyte[] input)

Handle strings

fromPacked
T[] fromPacked(ref ubyte[] input)

Handle packed fields.

fromVarint
T fromVarint(ref ubyte[] input)

Decodes a varint to the requested type.

genHeader
ubyte[] genHeader(int field, WireType wiretype)

Encodes a header.

getFieldNumber
int getFieldNumber(int header)

Provide the specified field number from the header.

getWireType
WireType getWireType(int header)

Provide the specified wiretype from the header.

ripUField
ubyte[] ripUField(ref ubyte[] input, int wiretype)

Remove unknown field from input.

toByteBlob
ubyte[] toByteBlob(T input, int field)

Fixed sized numeric types.

toByteString
ubyte[] toByteString(T[] input, int field)

Handle strings

toPacked
ubyte[] toPacked(in T[] packed, int field)

Handle packed fields.

toVarint
ubyte[] toVarint(bool input, int field)
ubyte[] toVarint(uint input, int field)
ubyte[] toVarint(int input, int field)
ubyte[] toVarint(ulong input, int field)
ubyte[] toVarint(long input, int field)

Encode a type as a varint.

toVarint
ubyte[] toVarint(long input)

Encode a varint without a header.

Meta