WPILibC++ 2023.4.3-108-ge5452e3
wpi::Uleb128Reader Class Reference

Unsigned LEB128 streaming reader. More...

#include <wpi/leb128.h>

Public Member Functions

std::optional< uint64_t > ReadOne (std::span< const uint8_t > *in)
 Decode a single ULEB128 value. More...
 

Detailed Description

Unsigned LEB128 streaming reader.

Decode an unsigned LEB128 encoded datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data".

Member Function Documentation

◆ ReadOne()

std::optional< uint64_t > wpi::Uleb128Reader::ReadOne ( std::span< const uint8_t > *  in)

Decode a single ULEB128 value.

Returns after a single ULEB128 value has been read or insufficient input (call in a loop to get multiple values). If a value is returned, internal state is reset so it's safe to immediately call this function again to decode another value.

Parameters
inInput data; modified as data is consumed (any unconsumed data is left when function returns).
Returns
value (in std::optional)

The documentation for this class was generated from the following file: