Tag Parser: matroska/matroskaseekinfo.h Source File

Tag Parser 12.5.3 C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags

Loading...
Searching...
No Matches
matroskaseekinfo.h
Go to the documentation of this file.
1#ifndef TAG_PARSER_MATROSKASEEKINFO_H
2#define TAG_PARSER_MATROSKASEEKINFO_H
3
4#include "./ebmlelement.h"
5
6#include <memory>
7#include <utility>
8#include <vector>
9
10namespace TagParser {
11
12 class TAG_PARSER_EXPORT MatroskaSeekInfo {
13public:
14 MatroskaSeekInfo();
15
16 const std::vector<EbmlElement *> &seekHeadElements() const;
17 const std::vector<std::pair<EbmlElement::IdentifierType, std::uint64_t>> &info() const;
18 std::vector<std::pair<EbmlElement::IdentifierType, std::uint64_t>> &info();
19 void shift(std::uint64_t start, std::int64_t amount);
20 void parse(EbmlElement *seekHeadElements, Diagnostics &diag, std::size_t maxIndirection = 1);
21 void make(std::ostream &stream, Diagnostics &diag);
22 std::uint64_t minSize() const;
23 std::uint64_t maxSize() const;
24 std::uint64_t actualSize() const;
25 bool push(unsigned int index, EbmlElement::IdentifierType id, std::uint64_t offset);
26 void clear();
27
28private:
29 std::vector<EbmlElement *> m_seekHeadElements;
30 std::vector<std::unique_ptr<EbmlElement>> m_additionalSeekHeadElements;
31 std::vector<std::pair<EbmlElement::IdentifierType, std::uint64_t>> m_info;
32};
33
37 inline MatroskaSeekInfo::MatroskaSeekInfo()
38{
39}
40
46 inline const std::vector<EbmlElement *> &MatroskaSeekInfo::seekHeadElements() const
47{
48 return m_seekHeadElements;
49}
50
55 inline const std::vector<std::pair<EbmlElement::IdentifierType, std::uint64_t>> &MatroskaSeekInfo::info() const
56{
57 return m_info;
58}
59
64 inline std::vector<std::pair<EbmlElement::IdentifierType, std::uint64_t>> &MatroskaSeekInfo::info()
65{
66 return m_info;
67}
68
69} // namespace TagParser
70
71#endif // TAG_PARSER_MATROSKASEEKINFO_H
TagParser::Diagnostics
The Diagnostics class is a container for DiagMessage.
Definition diagnostics.h:156
TagParser::EbmlElement
The EbmlElement class helps to parse EBML files such as Matroska files.
Definition ebmlelement.h:32
TagParser::GenericFileElement< EbmlElement >::IdentifierType
typename FileElementTraits< EbmlElement >::IdentifierType IdentifierType
Definition genericfileelement.h:56
TagParser::MatroskaSeekInfo::parse
void parse(EbmlElement *seekHeadElements, Diagnostics &diag, std::size_t maxIndirection=1)
Parses the specified seekHeadElement and populates info() with the gathered information.
Definition matroskaseekinfo.cpp:51
TagParser::MatroskaSeekInfo::seekHeadElements
const std::vector< EbmlElement * > & seekHeadElements() const
Returns a pointer to the seek head elements the seek information is composed of.
Definition matroskaseekinfo.h:46
TagParser::MatroskaSeekInfo::MatroskaSeekInfo
MatroskaSeekInfo()
Constructs a new MatroskaSeekInfo.
Definition matroskaseekinfo.h:37
TagParser::MatroskaSeekInfo::shift
void shift(std::uint64_t start, std::int64_t amount)
Shifts all offsets greater or equal than start by amount bytes.
Definition matroskaseekinfo.cpp:25
TagParser::MatroskaSeekInfo::clear
void clear()
Resets the object to its initial state.
Definition matroskaseekinfo.cpp:251
TagParser::MatroskaSeekInfo::push
bool push(unsigned int index, EbmlElement::IdentifierType id, std::uint64_t offset)
Pushes the specified offset of an element with the specified id to the info.
Definition matroskaseekinfo.cpp:231
TagParser::MatroskaSeekInfo::make
void make(std::ostream &stream, Diagnostics &diag)
Writes a "SeekHead" element for the current instance to the specified stream.
Definition matroskaseekinfo.cpp:147
TagParser::MatroskaSeekInfo::maxSize
std::uint64_t maxSize() const
Returns the maximal number of bytes written when calling the make() method.
Definition matroskaseekinfo.cpp:202
TagParser::MatroskaSeekInfo::minSize
std::uint64_t minSize() const
Returns the minimal number of bytes written when calling the make() method.
Definition matroskaseekinfo.cpp:192
TagParser::MatroskaSeekInfo::info
const std::vector< std::pair< EbmlElement::IdentifierType, std::uint64_t > > & info() const
Returns the seek information gathered when the parse() method was called.
Definition matroskaseekinfo.h:55
TagParser::MatroskaSeekInfo::actualSize
std::uint64_t actualSize() const
Returns the number of bytes which will be written when calling the make() method.
Definition matroskaseekinfo.cpp:212
ebmlelement.h
TAG_PARSER_EXPORT
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Definition global.h:14
TagParser
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10