|
LibQuicR
|
#include <uintvar.h>
Public Member Functions | |
| constexpr | UintVar (uint64_t value) noexcept |
| constexpr | UintVar (std::span< const std::uint8_t > bytes, const std::source_location caller=std::source_location::current()) |
| constexpr | UintVar (const UintVar &other) noexcept=default |
| constexpr | UintVar (UintVar &&other) noexcept=default |
| constexpr UintVar & | operator= (const UintVar &other) noexcept=default |
| constexpr UintVar & | operator= (UintVar &&other) noexcept=default |
| constexpr UintVar & | operator= (std::uint64_t value) |
| constexpr std::uint64_t | Get () const noexcept |
| constexpr std::size_t | Size () const noexcept |
| constexpr const std::uint8_t * | data () const noexcept |
| constexpr std::size_t | size () const noexcept |
| constexpr auto | begin () const noexcept |
| constexpr auto | end () const noexcept |
| constexpr | operator uint64_t () const noexcept |
| constexpr auto | operator<=> (const UintVar &other) const noexcept=default |
Static Public Member Functions | |
| static constexpr std::size_t | Size (uint8_t msb_bytes) noexcept |
MoQ variable-length encoding of an unsigned 64-bit integer.
The encoded width is one through nine bytes. Leading one bits in the first byte identify the width; 0xFF introduces the nine-byte form. Construction from an integer produces the shortest encoding, while construction from bytes preserves the encoded width supplied by the caller (including valid non-minimal encodings).
|
inlineconstexprnoexcept |
Encodes a value using its shortest representation.
| value | Unsigned value to encode. |
|
inlineconstexpr |
Copies one encoded value from the beginning of a byte span. Trailing bytes are ignored.
| bytes | Span beginning with an encoded value. |
| caller | Source location used when reporting malformed input. |
| UintVarInvalidArgException | if the span is empty or shorter than the width indicated by its first byte. |
|
constexprdefaultnoexcept |
Copies an encoded value.
| other | Value to copy. |
|
constexprdefaultnoexcept |
Moves an encoded value.
| other | Value to move. |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
constexprdefaultnoexcept |
Compares the complete stored encoding, including encoded width.
| other | Encoding to compare. |
Copy-assigns an encoded value.
| other | Value to copy. |
|
inlineconstexpr |
Replaces this encoding with the shortest encoding of a value.
| value | Unsigned value to encode. |
Move-assigns an encoded value.
| other | Value to move. |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
Determines an encoded width from its first byte.
| msb_bytes | First byte of an encoding. |