1#ifndef TAG_PARSER_EBMLELEMENT_H
2#define TAG_PARSER_EBMLELEMENT_H
9#include <c++utilities/conversion/stringbuilder.h>
10#include <c++utilities/conversion/stringconversion.h>
50 static std::uint8_t
makeSizeDenotation(std::uint64_t size,
char *buff, std::uint8_t minBytes);
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);
65 std::string parsingContext()
const;
75 return argsToString(
'0',
'x', numberToString(
id(), 16u),
' ',
'\"', name,
'\"');
77 return "0x" + numberToString(
id(), 16u);
94 case SignatureElements:
95 case SignatureElementList:
100 case ChapterTranslate:
115 case TrackCombinePlanes:
117 case TrackJoinBlocks:
118 case ContentEncodings:
119 case ContentEncoding:
120 case ContentCompression:
121 case ContentEncryption:
124 case CueTrackPositions:
134 case ChapProcessCommand:
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::uint8_t makeUInteger(std::uint64_t value, char *buff)
Writes value to buff.
EbmlElement(MatroskaContainer &container, std::uint64_t startOffset)
Constructs a new top level element with the specified container at the specified startOffset.
static std::uint8_t calculateIdLength(IdentifierType id)
Returns the length of the specified id in byte.
static void makeSimpleElement(std::ostream &stream, IdentifierType id, std::uint64_t content)
Makes a simple EBML element.
static std::uint8_t calculateSizeDenotationLength(std::uint64_t size)
Returns the length of the size denotation for the specified size in byte.
static std::uint8_t makeId(IdentifierType id, char *buff)
Stores the specified id in the specified buffer which must be at least 8 bytes long.
double readFloat()
Reads the content of the element as float.
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.
std::string readString()
Reads the content of the element as string.
std::uint64_t readUInteger()
Reads the content of the element as unsigned integer.
static std::uint8_t makeSizeDenotation(std::uint64_t size, char *buff)
Makes the size denotation for the specified size and stores it to buff.
void internalParse(Diagnostics &diag)
Parses the EBML element.
static std::uint8_t calculateUIntegerLength(std::uint64_t integer)
Returns the length of the specified unsigned integer in byte.
bool isParent() const
Returns an indication whether the element is a parent element.
MatroskaContainer ContainerType
std::uint64_t DataSizeType
std::uint32_t IdentifierType
Defines traits for the specified ImplementationType.
GenericFileElement(ContainerType &container, std::uint64_t startOffset)
std::uint64_t startOffset() const
const IdentifierType & id() const
std::uint32_t sizeLength() const
typename FileElementTraits< EbmlElement >::IdentifierType IdentifierType
ContainerType & container()
std::uint32_t idLength() const
Implementation of GenericContainer<MediaFileInfo, MatroskaTag, MatroskaTrack, EbmlElement>.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Encapsulates all EBML ID values.
Encapsulates the most common Matroska element IDs.
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.