1 #ifndef TAG_PARSER_EBMLELEMENT_H
2 #define TAG_PARSER_EBMLELEMENT_H
7 #include "../genericfileelement.h"
9 #include <c++utilities/conversion/stringbuilder.h>
10 #include <c++utilities/conversion/stringconversion.h>
15 #include <string_view>
20 class MatroskaContainer;
38 std::string idToString()
const;
39 bool isParent()
const;
40 bool isPadding()
const;
41 std::uint64_t firstChildOffset()
const;
42 std::string readString();
43 std::uint64_t readUInteger();
46 static std::uint8_t calculateIdLength(IdentifierType
id);
47 static std::uint8_t calculateSizeDenotationLength(std::uint64_t size);
48 static std::uint8_t makeId(IdentifierType
id,
char *buff);
49 static std::uint8_t makeSizeDenotation(std::uint64_t size,
char *buff);
50 static std::uint8_t makeSizeDenotation(std::uint64_t size,
char *buff, std::uint8_t minBytes);
51 static std::uint8_t calculateUIntegerLength(std::uint64_t integer);
52 static std::uint8_t makeUInteger(std::uint64_t value,
char *buff);
53 static std::uint8_t makeUInteger(std::uint64_t value,
char *buff, std::uint8_t minBytes);
54 static void makeSimpleElement(std::ostream &stream, IdentifierType
id, std::uint64_t content);
55 static void makeSimpleElement(std::ostream &stream, IdentifierType
id, std::string_view content);
65 std::string parsingContext()
const;
75 return argsToString(
'0',
'x', numberToString(
id(), 16u),
' ',
'\"', name,
'\"');
77 return "0x" + numberToString(
id(), 16u);
89 using namespace EbmlIds;
90 using namespace MatroskaIds;
The Diagnostics class is a container for DiagMessage.
The EbmlElement class helps to parse EBML files such as Matroska files.
static void makeSimpleElement(std::ostream &stream, IdentifierType id, std::string_view content)
std::uint64_t firstChildOffset() const
Returns the offset of the first child of the element.
bool isPadding() const
Returns an indication whether the element is considered as padding.
static std::uint64_t bytesToBeSkipped
Specifies the number of bytes to be skipped till a valid EBML element is found in the stream.
std::string idToString() const
Converts the specified EBML ID to a printable string.
bool isParent() const
Returns an indication whether the element is a parent element.
std::uint64_t DataSizeType
std::uint32_t IdentifierType
Defines traits for the specified ImplementationType.
The GenericFileElement class helps to parse binary files which consist of an arboreal element structu...
const IdentifierType & id() const
Returns the element ID.
std::uint32_t sizeLength() const
Returns the length of the size denotation of the element in byte.
std::uint32_t idLength() const
Returns the length of the id denotation in byte.
Implementation of GenericContainer<MediaFileInfo, MatroskaTag, MatroskaTrack, EbmlElement>.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Contains all classes and functions of the TagInfo library.
TAG_PARSER_EXPORT std::string_view matroskaIdName(std::uint32_t matroskaId)
Returns a string for the specified matroskaId if known; otherwise returns an empty string.