Tag Parser  7.0.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Public Member Functions | Static Public Member Functions | List of all members
TagParser::MatroskaSeekInfo Class Reference

#include <matroskaseekinfo.h>

Public Member Functions

 MatroskaSeekInfo ()
 Constructs a new MatroskaSeekInfo. More...
 
EbmlElementseekHeadElement () const
 Returns a pointer to the seekHeadElement specified when the parse() method was called. More...
 
const std::vector< std::pair< EbmlElement::IdentifierType, uint64 > > & info () const
 Returns the seek information gathered when the parse() method was called. More...
 
std::vector< std::pair< EbmlElement::IdentifierType, uint64 > > & info ()
 Returns a mutable version of the seek information gathered when the parse() method was called. More...
 
void shift (uint64 start, int64 amount)
 Shifts all offsets greather or equal than start by amount bytes. More...
 
void parse (EbmlElement *seekHeadElement, Diagnostics &diag)
 Parses the specified seekHeadElement. More...
 
void make (std::ostream &stream, Diagnostics &diag)
 Writes a "SeekHead" element for the current instance to the specified stream. More...
 
uint64 minSize () const
 Returns the minimal number of bytes written when calling the make() method. More...
 
uint64 maxSize () const
 Returns the maximal number of bytes written when calling the make() method. More...
 
uint64 actualSize () const
 Returns the number of bytes which will be written when calling the make() method. More...
 
bool push (unsigned int index, EbmlElement::IdentifierType id, uint64 offset)
 Pushes the specified offset of an element with the specified id to the info. More...
 
void clear ()
 Resets the object to its initial state. More...
 

Static Public Member Functions

static std::pair< EbmlElement::IdentifierType, uint64 > * findSeekInfo (std::vector< MatroskaSeekInfo > &seekInfos, uint64 offset)
 Returns a pointer to the first pair with the specified offset or nullptr if no such pair could be found. More...
 
static bool updateSeekInfo (const std::vector< MatroskaSeekInfo > &oldSeekInfos, std::vector< MatroskaSeekInfo > &newSeekInfos, uint64 oldOffset, uint64 newOffset)
 Sets the offset of all entires in newSeekInfos to newOffset where the corresponding entry in oldSeekInfos has the offset oldOffset. More...
 
static bool updateSeekInfo (std::vector< MatroskaSeekInfo > &newSeekInfos, uint64 oldOffset, uint64 newOffset)
 Sets the offset of all entires in newSeekInfos to newOffset where the offset is oldOffset. More...
 

Detailed Description

Definition at line 10 of file matroskaseekinfo.h.

Constructor & Destructor Documentation

◆ MatroskaSeekInfo()

TagParser::MatroskaSeekInfo::MatroskaSeekInfo ( )
inline

Constructs a new MatroskaSeekInfo.

Definition at line 40 of file matroskaseekinfo.h.

Member Function Documentation

◆ actualSize()

uint64 TagParser::MatroskaSeekInfo::actualSize ( ) const

Returns the number of bytes which will be written when calling the make() method.

Remarks
The returned value gets invalidated when the object is mutated.

Definition at line 170 of file matroskaseekinfo.cpp.

◆ clear()

void TagParser::MatroskaSeekInfo::clear ( )

Resets the object to its initial state.

Definition at line 208 of file matroskaseekinfo.cpp.

◆ findSeekInfo()

std::pair< EbmlElement::IdentifierType, uint64 > * TagParser::MatroskaSeekInfo::findSeekInfo ( std::vector< MatroskaSeekInfo > &  seekInfos,
uint64  offset 
)
static

Returns a pointer to the first pair with the specified offset or nullptr if no such pair could be found.

Definition at line 217 of file matroskaseekinfo.cpp.

◆ info() [1/2]

const std::vector< std::pair< EbmlElement::IdentifierType, uint64 > > & TagParser::MatroskaSeekInfo::info ( ) const
inline

Returns the seek information gathered when the parse() method was called.

Returns
Returns the seek information as pairs of element IDs and the associated offsets (relative to the beginning of the file).

Definition at line 57 of file matroskaseekinfo.h.

◆ info() [2/2]

std::vector< std::pair< EbmlElement::IdentifierType, uint64 > > & TagParser::MatroskaSeekInfo::info ( )
inline

Returns a mutable version of the seek information gathered when the parse() method was called.

Returns
Returns the seek information as pairs of element IDs and the associated offsets (relative to the beginning of the file).

Definition at line 66 of file matroskaseekinfo.h.

◆ make()

void TagParser::MatroskaSeekInfo::make ( std::ostream &  stream,
Diagnostics diag 
)

Writes a "SeekHead" element for the current instance to the specified stream.

Parameters
streamSpecifies the stream to write the "SeekHead" element to.
Exceptions
Throwsios_base::failure when an IO error occurs.
ThrowsFailure or a derived exception when a making error occurs.

Definition at line 107 of file matroskaseekinfo.cpp.

◆ maxSize()

uint64 TagParser::MatroskaSeekInfo::maxSize ( ) const

Returns the maximal number of bytes written when calling the make() method.

Remarks
The returned value gets invalidated when the object is mutated.

Definition at line 160 of file matroskaseekinfo.cpp.

◆ minSize()

uint64 TagParser::MatroskaSeekInfo::minSize ( ) const

Returns the minimal number of bytes written when calling the make() method.

Remarks
The returned value gets invalidated when the object is mutated.

Definition at line 150 of file matroskaseekinfo.cpp.

◆ parse()

void TagParser::MatroskaSeekInfo::parse ( EbmlElement seekHeadElement,
Diagnostics diag 
)

Parses the specified seekHeadElement.

Exceptions
Throwsios_base::failure when an IO error occurs.
ThrowsFailure or a derived exception when a parsing error occurs.
Remarks
The object does not take ownership over the specified seekHeadElement.

Definition at line 40 of file matroskaseekinfo.cpp.

◆ push()

bool TagParser::MatroskaSeekInfo::push ( unsigned int  index,
EbmlElement::IdentifierType  id,
uint64  offset 
)

Pushes the specified offset of an element with the specified id to the info.

If there is an existing entry with the same id and index the existing entry will be updated and no new entry created.

Returns
Returns an indication whether the actualSize() has changed.

Definition at line 188 of file matroskaseekinfo.cpp.

◆ seekHeadElement()

EbmlElement * TagParser::MatroskaSeekInfo::seekHeadElement ( ) const
inline

Returns a pointer to the seekHeadElement specified when the parse() method was called.

Definition at line 48 of file matroskaseekinfo.h.

◆ shift()

void TagParser::MatroskaSeekInfo::shift ( uint64  start,
int64  amount 
)

Shifts all offsets greather or equal than start by amount bytes.

Definition at line 25 of file matroskaseekinfo.cpp.

◆ updateSeekInfo() [1/2]

bool TagParser::MatroskaSeekInfo::updateSeekInfo ( const std::vector< MatroskaSeekInfo > &  oldSeekInfos,
std::vector< MatroskaSeekInfo > &  newSeekInfos,
uint64  oldOffset,
uint64  newOffset 
)
static

Sets the offset of all entires in newSeekInfos to newOffset where the corresponding entry in oldSeekInfos has the offset oldOffset.

Returns
Returns an indication whether the update altered the offset length.

Definition at line 233 of file matroskaseekinfo.cpp.

◆ updateSeekInfo() [2/2]

bool TagParser::MatroskaSeekInfo::updateSeekInfo ( std::vector< MatroskaSeekInfo > &  newSeekInfos,
uint64  oldOffset,
uint64  newOffset 
)
static

Sets the offset of all entires in newSeekInfos to newOffset where the offset is oldOffset.

Returns
Returns an whether at least one offset has been updated.

Definition at line 259 of file matroskaseekinfo.cpp.


The documentation for this class was generated from the following files: