Function readSVarint32
Decode one protobuf sint32 value.
bool readSVarint32(
scope ref WireCursor cursor,
out int value,
out WireStatus status
) nothrow @nogc @safe;
Parameters
| Name | Description |
|---|---|
| cursor | Cursor positioned at the first byte of the encoded varint. |
| value | Receives the ZigZag-decoded signed value on success. |
| status | Receives success or a wire-decoding failure. |
Returns
true on success; false only if the underlying 64-bit varint is invalid.
Notes
As for protobuf generated parsers, over-wide legal varints are truncated to 32 bits before ZigZag decoding.