Leviathan  0.8.0.0
Leviathan game engine
Leviathan::EBMLLengthValue Struct Reference

Decodes a length encoded in EBML. More...

+ Inheritance diagram for Leviathan::EBMLLengthValue:

Public Member Functions

 EBMLLengthValue (const EBMLLengthValue &other)=default
 
EBMLLengthValueoperator= (const EBMLLengthValue &other)=default
 
template<class T >
 EBMLLengthValue (T &stream)
 Read from stream. More...
 

Additional Inherited Members

- Public Attributes inherited from Leviathan::CommonVariableLengthValue
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 inherited from Leviathan::CommonVariableLengthValue
template<class T >
void ReadNextBytes (T &stream, int firstbyte, int count)
 

Detailed Description

Decodes a length encoded in EBML.

Definition at line 141 of file MatroskaParser.cpp.

Constructor & Destructor Documentation

◆ EBMLLengthValue() [1/2]

Leviathan::EBMLLengthValue::EBMLLengthValue ( const EBMLLengthValue other)
default

◆ EBMLLengthValue() [2/2]

template<class T >
Leviathan::EBMLLengthValue::EBMLLengthValue ( T &  stream)
inline

Read from stream.

Definition at line 148 of file MatroskaParser.cpp.

149  {
150  int byte = 0;
151  byte = stream.get();
152 
153  CHECK_BYTE_COUNT(ONE, 1);
154  CHECK_BYTE_COUNT(TWO, 2);
155  CHECK_BYTE_COUNT(THREE, 3);
156  CHECK_BYTE_COUNT(FOUR, 4);
157  CHECK_BYTE_COUNT(FIVE, 5);
158  CHECK_BYTE_COUNT(SIX, 6);
159  CHECK_BYTE_COUNT(SEVEN, 7);
160  CHECK_BYTE_COUNT(EIGHT, 8);
161 
162  throw InvalidState(
163  "MatroskaParser: EBML variable length, length field could not be handled, "
164  "first byte: " +
165  std::to_string(byte));
166  }
#define CHECK_BYTE_COUNT(countname, count)

Member Function Documentation

◆ operator=()

EBMLLengthValue& Leviathan::EBMLLengthValue::operator= ( const EBMLLengthValue other)
default

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