PHP Class Protobuf\WireFormat

Author: Iván Montes ([email protected])
Author: Fabio B. Silva ([email protected])
Show file Open project: protobuf-php/protobuf Class Usage Examples

Public Methods

Method Description
assertWireType ( integer $wire, integer $type ) Assert the wire type match
getFieldKey ( integer $tag, integer $wireType ) : integer Makes a tag value given a field number and wire type
getTagFieldNumber ( integer $tag ) : integer Given a tag value, determines the field number (the upper 29 bits).
getTagWireType ( integer $tag ) : integer Given a tag value, determines the wire type (the lower 3 bits).
getWireType ( integer $type, integer $default ) : integer Given a field type, determines the wire type.

Method Details

assertWireType() public static method

Assert the wire type match
public static assertWireType ( integer $wire, integer $type )
$wire integer
$type integer

getFieldKey() public static method

Makes a tag value given a field number and wire type
public static getFieldKey ( integer $tag, integer $wireType ) : integer
$tag integer
$wireType integer
return integer

getTagFieldNumber() public static method

Given a tag value, determines the field number (the upper 29 bits).
public static getTagFieldNumber ( integer $tag ) : integer
$tag integer
return integer

getTagWireType() public static method

Given a tag value, determines the wire type (the lower 3 bits).
public static getTagWireType ( integer $tag ) : integer
$tag integer
return integer

getWireType() public static method

Given a field type, determines the wire type.
public static getWireType ( integer $type, integer $default ) : integer
$type integer
$default integer
return integer