Functions | |
def | _DecodeFixed32 (buffer, pos) |
def | _DecodeFixed64 (buffer, pos) |
def | _DecodeUnknownField (buffer, pos, wire_type) |
def | _DecodeUnknownFieldSet (buffer, pos, end_pos=None) |
def | _DoubleDecoder () |
def | _EndGroup (buffer, pos, end) |
def | _FieldSkipper () |
def | _FloatDecoder () |
def | _ModifiedDecoder (wire_type, decode_value, modify_value) |
def | _RaiseInvalidWireType (buffer, pos, end) |
def | _SignedVarintDecoder (bits, result_type) |
def | _SimpleDecoder (wire_type, decode_value) |
def | _SkipFixed32 (buffer, pos, end) |
def | _SkipFixed64 (buffer, pos, end) |
def | _SkipGroup (buffer, pos, end) |
def | _SkipLengthDelimited (buffer, pos, end) |
def | _SkipVarint (buffer, pos, end) |
def | _StructPackDecoder (wire_type, format) |
def | _VarintDecoder (mask, result_type) |
def | BytesDecoder (field_number, is_repeated, is_packed, key, new_default) |
def | EnumDecoder (field_number, is_repeated, is_packed, key, new_default) |
def | GroupDecoder (field_number, is_repeated, is_packed, key, new_default) |
def | MapDecoder (field_descriptor, new_default, is_message_map) |
def | MessageDecoder (field_number, is_repeated, is_packed, key, new_default) |
def | MessageSetItemDecoder (descriptor) |
def | ReadTag (buffer, pos) |
def | StringDecoder (field_number, is_repeated, is_packed, key, new_default, is_strict_utf8=False) |
|
private |
Decode a fixed32.
Definition at line 972 of file decoder.py.
|
private |
Decode a fixed64.
Definition at line 890 of file decoder.py.
|
private |
Decode a unknown field. Returns the UnknownField and new position.
Definition at line 934 of file decoder.py.
|
private |
Decode UnknownFieldSet. Returns the UnknownFieldSet and new position.
Definition at line 917 of file decoder.py.
|
private |
Returns a decoder for a double field. This code works around a bug in struct.unpack for not-a-number.
Definition at line 346 of file decoder.py.
|
private |
Skipping an END_GROUP tag returns -1 to tell the parent loop to break.
Definition at line 957 of file decoder.py.
|
private |
Constructs the SkipField function.
Definition at line 984 of file decoder.py.
|
private |
Returns a decoder for a float field. This code works around a bug in struct.unpack for non-finite 32-bit floating-point values.
Definition at line 301 of file decoder.py.
|
private |
Like SimpleDecoder but additionally invokes modify_value on every value before storing it. Usually modify_value is ZigZagDecode.
Definition at line 262 of file decoder.py.
|
private |
Skip function for unknown wire types. Raises an exception.
Definition at line 979 of file decoder.py.
|
private |
Like _VarintDecoder() but decodes signed values.
Definition at line 139 of file decoder.py.
|
private |
Return a constructor for a decoder for fields of a particular type. Args: wire_type: The field's wire type. decode_value: A function which decodes an individual value, e.g. _DecodeVarint()
Definition at line 203 of file decoder.py.
|
private |
Skip a fixed32 value. Returns the new position.
Definition at line 963 of file decoder.py.
|
private |
Skip a fixed64 value. Returns the new position.
Definition at line 881 of file decoder.py.
|
private |
Skip sub-group. Returns the new position.
Definition at line 906 of file decoder.py.
|
private |
Skip a length-delimited value. Returns the new position.
Definition at line 896 of file decoder.py.
|
private |
Skip a varint value. Returns the new position.
Definition at line 869 of file decoder.py.
|
private |
Return a constructor for a decoder for a fixed-width field. Args: wire_type: The field's wire type. format: The format string to pass to struct.unpack().
Definition at line 276 of file decoder.py.
|
private |
Return an encoder for a basic varint value (does not include tag). Decoded values will be bitwise-anded with the given mask before being returned, e.g. to limit them to 32 bits. The returned decoder does not take the usual "end" parameter -- the caller is expected to do bounds checking after the fact (often the caller can defer such checking until later). The decoder returns a (value, new_pos) pair.
Definition at line 112 of file decoder.py.
def google.protobuf.internal.decoder.BytesDecoder | ( | field_number, | |
is_repeated, | |||
is_packed, | |||
key, | |||
new_default | |||
) |
Returns a decoder for a bytes field.
Definition at line 597 of file decoder.py.
def google.protobuf.internal.decoder.EnumDecoder | ( | field_number, | |
is_repeated, | |||
is_packed, | |||
key, | |||
new_default | |||
) |
Definition at line 386 of file decoder.py.
def google.protobuf.internal.decoder.GroupDecoder | ( | field_number, | |
is_repeated, | |||
is_packed, | |||
key, | |||
new_default | |||
) |
Returns a decoder for a group field.
Definition at line 634 of file decoder.py.
def google.protobuf.internal.decoder.MapDecoder | ( | field_descriptor, | |
new_default, | |||
is_message_map | |||
) |
Returns a decoder for a map field.
Definition at line 823 of file decoder.py.
def google.protobuf.internal.decoder.MessageDecoder | ( | field_number, | |
is_repeated, | |||
is_packed, | |||
key, | |||
new_default | |||
) |
Returns a decoder for a message field.
Definition at line 681 of file decoder.py.
def google.protobuf.internal.decoder.MessageSetItemDecoder | ( | descriptor | ) |
Returns a decoder for a MessageSet item. The parameter is the message Descriptor. The message set message looks like this: message MessageSet { repeated group Item = 1 { required int32 type_id = 2; required string message = 3; } }
Definition at line 735 of file decoder.py.
def google.protobuf.internal.decoder.ReadTag | ( | buffer, | |
pos | |||
) |
Read a tag from the memoryview, and return a (tag_bytes, new_pos) tuple. We return the raw bytes of the tag rather than decoding them. The raw bytes can then be used to look up the proper decoder. This effectively allows us to trade some work that would be done in pure-python (decoding a varint) for work that is done in C (searching for a byte string in a hash table). In a low-level language it would be much cheaper to decode the varint and use that, but not in Python. Args: buffer: memoryview object of the encoded bytes pos: int of the current position to start from Returns: Tuple[bytes, int] of the tag data and new position.
Definition at line 174 of file decoder.py.
def google.protobuf.internal.decoder.StringDecoder | ( | field_number, | |
is_repeated, | |||
is_packed, | |||
key, | |||
new_default, | |||
is_strict_utf8 = False |
|||
) |
Returns a decoder for a string field.
Definition at line 537 of file decoder.py.
|
private |
Definition at line 81 of file decoder.py.
|
private |
Definition at line 109 of file decoder.py.
|
private |
Definition at line 167 of file decoder.py.
|
private |
Definition at line 171 of file decoder.py.
|
private |
Definition at line 166 of file decoder.py.
|
private |
Definition at line 170 of file decoder.py.
|
private |
Definition at line 104 of file decoder.py.
|
private |
Definition at line 103 of file decoder.py.
|
private |
Definition at line 102 of file decoder.py.
|
private |
Definition at line 92 of file decoder.py.
|
private |
Definition at line 87 of file decoder.py.
def google.protobuf.internal.decoder.BoolDecoder |
Definition at line 533 of file decoder.py.
def google.protobuf.internal.decoder.DoubleDecoder = _DoubleDecoder() |
Definition at line 531 of file decoder.py.
def google.protobuf.internal.decoder.Fixed32Decoder = _StructPackDecoder(wire_format.WIRETYPE_FIXED32, '<I') |
Definition at line 526 of file decoder.py.
def google.protobuf.internal.decoder.Fixed64Decoder = _StructPackDecoder(wire_format.WIRETYPE_FIXED64, '<Q') |
Definition at line 527 of file decoder.py.
def google.protobuf.internal.decoder.FloatDecoder = _FloatDecoder() |
Definition at line 530 of file decoder.py.
def google.protobuf.internal.decoder.Int32Decoder |
Definition at line 508 of file decoder.py.
def google.protobuf.internal.decoder.Int64Decoder |
Definition at line 511 of file decoder.py.
google.protobuf.internal.decoder.long = int |
Definition at line 89 of file decoder.py.
google.protobuf.internal.decoder.MESSAGE_SET_ITEM_TAG = encoder.TagBytes(1, wire_format.WIRETYPE_START_GROUP) |
Definition at line 733 of file decoder.py.
def google.protobuf.internal.decoder.SFixed32Decoder = _StructPackDecoder(wire_format.WIRETYPE_FIXED32, '<i') |
Definition at line 528 of file decoder.py.
def google.protobuf.internal.decoder.SFixed64Decoder = _StructPackDecoder(wire_format.WIRETYPE_FIXED64, '<q') |
Definition at line 529 of file decoder.py.
def google.protobuf.internal.decoder.SInt32Decoder |
Definition at line 517 of file decoder.py.
def google.protobuf.internal.decoder.SInt64Decoder |
Definition at line 519 of file decoder.py.
def google.protobuf.internal.decoder.SkipField = _FieldSkipper() |
Definition at line 1016 of file decoder.py.
def google.protobuf.internal.decoder.UInt32Decoder = _SimpleDecoder(wire_format.WIRETYPE_VARINT, _DecodeVarint32) |
Definition at line 514 of file decoder.py.
def google.protobuf.internal.decoder.UInt64Decoder = _SimpleDecoder(wire_format.WIRETYPE_VARINT, _DecodeVarint) |
Definition at line 515 of file decoder.py.