5 #include <c++utilities/conversion/stringbuilder.h> 6 #include <c++utilities/conversion/stringconversion.h> 7 #include <c++utilities/io/binaryreader.h> 10 using namespace ConversionUtilities;
23 Mpeg4Descriptor::Mpeg4Descriptor(
ContainerType &container, uint64 startOffset, uint64 maxSize)
39 string Mpeg4Descriptor::parsingContext()
const 49 return "0x" + ConversionUtilities::numberToString(
id(), 16);
60 "Descriptor is smaller than 2 byte and hence invalid. The maximum size within the encloding element is " % numberToString(
maxTotalSize())
62 "parsing MPEG-4 descriptor");
70 byte tmp =
reader().readByte();
78 diag.emplace_back(
DiagLevel::Warning,
"The descriptor seems to be truncated; unable to parse siblings of that ", parsingContext());
std::string idToString() const
Converts the specified atom ID to a printable string.
The exception that is thrown when the data to be parsed is truncated and therefore can not be parsed ...
std::unique_ptr< ImplementationType > m_firstChild
The Mpeg4Descriptor class helps to parse MPEG-4 descriptors.
std::unique_ptr< ImplementationType > m_nextSibling
uint64 startOffset() const
Returns the start offset in the related stream.
uint64 totalSize() const
Returns the total size of the element.
The GenericFileElement class helps to parse binary files which consist of an arboreal element strucut...
static constexpr byte minimumElementSize()
Returns the mimimum element size.
IoUtilities::BinaryReader & reader()
Returns the related BinaryReader.
void internalParse(Diagnostics &diag)
Parses the MPEG-4 descriptor.
ContainerType & container()
Returns the related container.
uint64 maxTotalSize() const
Returns maximum total size.
Mpeg4Descriptor(ContainerType &container, uint64 startOffset, uint64 maxSize)
Constructs a new top level descriptor with the specified container at the specified startOffset and w...
typename FileElementTraits< ImplementationType >::ContainerType ContainerType
Specifies the type of the corresponding container.
std::iostream & stream()
Returns the related stream.
Contains all classes and functions of the TagInfo library.
The Diagnostics class is a container for DiagMessage.
ImplementationType * parent()
Returns the parent of the element.