Leviathan  0.8.0.0
Leviathan game engine
Leviathan::CommonVariableLengthValue Struct Reference
+ Inheritance diagram for Leviathan::CommonVariableLengthValue:

Public Attributes

uint64_t Value
 The contents of this value. More...
 
int ByteLength = 1
 The length in bytes that this value took in the file. More...
 

Protected Member Functions

template<class T >
void ReadNextBytes (T &stream, int firstbyte, int count)
 

Detailed Description

Definition at line 118 of file MatroskaParser.cpp.

Member Function Documentation

◆ ReadNextBytes()

template<class T >
void Leviathan::CommonVariableLengthValue::ReadNextBytes ( T &  stream,
int  firstbyte,
int  count 
)
inlineprotected

Definition at line 121 of file MatroskaParser.cpp.

122  {
123  ByteLength = count + 1;
124  Value = static_cast<uint64_t>(firstbyte) << (count * BITS_IN_BYTE);
125 
126  for(; count > 0; --count) {
127  int byte = stream.get();
128  Value += static_cast<uint64_t>(byte) << ((count - 1) * BITS_IN_BYTE);
129  }
130  }
int ByteLength
The length in bytes that this value took in the file.
constexpr auto BITS_IN_BYTE
Definition: Define.h:47
uint64_t Value
The contents of this value.

Member Data Documentation

◆ ByteLength

int Leviathan::CommonVariableLengthValue::ByteLength = 1

The length in bytes that this value took in the file.

Definition at line 137 of file MatroskaParser.cpp.

◆ Value

uint64_t Leviathan::CommonVariableLengthValue::Value

The contents of this value.

Definition at line 134 of file MatroskaParser.cpp.


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