Tag Parser 12.1.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
Public Member Functions | List of all members
TagParser::MatroskaAttachment Class Referencefinal

Implementation of TagParser::AbstractAttachment for the Matroska container. More...

#include <matroskaattachment.h>

Inheritance diagram for TagParser::MatroskaAttachment:
[legend]
Collaboration diagram for TagParser::MatroskaAttachment:
[legend]

Public Member Functions

 MatroskaAttachment ()
 Constructs a new Matroska attachment.
 
void parse (EbmlElement *attachedFileElement, Diagnostics &diag)
 Parses attachment from the specified attachedFileElement.
 
MatroskaAttachmentMaker prepareMaking (Diagnostics &diag)
 Prepares making.
 
void make (std::ostream &stream, Diagnostics &diag)
 Writes the attachment to the specified stream (makes an "AttachedFile"-element).
 
EbmlElementattachedFileElement () const
 Returns the "AttachedFile"-element which has been specified when the parse() method has been called.
 
- Public Member Functions inherited from TagParser::AbstractAttachment
const std::string & description () const
 Returns a description of the attachment.
 
void setDescription (std::string_view description)
 Sets a description of the attachment.
 
const std::string & name () const
 Returns the (file) name of the attachment.
 
void setName (std::string_view name)
 Sets the (file) name of the attachment.
 
const std::string & mimeType () const
 Returns the MIME-type of the attachment.
 
void setMimeType (std::string_view mimeType)
 Sets the MIME-type of the attachment.
 
std::uint64_t id () const
 Returns the ID of the attachment.
 
void setId (std::uint64_t id)
 Sets the ID of the attachment.
 
const StreamDataBlockdata () const
 Returns a reference to the data of the attachment.
 
void setData (std::unique_ptr< StreamDataBlock > &&data)
 Sets the data for the attachment.
 
void setFile (std::string_view path, Diagnostics &diag, AbortableProgressFeedback &progress)
 Sets the data, name and MIME-type for the specified path.
 
bool isDataFromFile () const
 Returns whether the assigned data has been assigned using the setFile() method.
 
std::string label () const
 Returns a label for the track.
 
void clear ()
 Resets the object to its initial state.
 
bool isIgnored () const
 Returns whether the attachment is ignored/omitted when rewriting the container.
 
void setIgnored (bool ignored)
 Sets whether the attachment is ignored/omitted when rewriting the container.
 
bool isEmpty () const
 Returns whether the attachment is empty (no data and no meta-data assigned).
 

Additional Inherited Members

- Protected Member Functions inherited from TagParser::AbstractAttachment
 AbstractAttachment ()
 Constructs a new attachment.
 
virtual ~AbstractAttachment ()
 Destroys the attachment.
 

Detailed Description

Implementation of TagParser::AbstractAttachment for the Matroska container.

Definition at line 44 of file matroskaattachment.h.

Constructor & Destructor Documentation

◆ MatroskaAttachment()

TagParser::MatroskaAttachment::MatroskaAttachment ( )
inline

Constructs a new Matroska attachment.

Definition at line 61 of file matroskaattachment.h.

Member Function Documentation

◆ attachedFileElement()

EbmlElement * TagParser::MatroskaAttachment::attachedFileElement ( ) const
inline

Returns the "AttachedFile"-element which has been specified when the parse() method has been called.

Definition at line 69 of file matroskaattachment.h.

◆ make()

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

Writes the attachment to the specified stream (makes an "AttachedFile"-element).

Exceptions
Throwsstd::ios_base::failure when an IO error occurs.
ThrowsTagParser::Failure or a derived exception when a making error occurs.
See also
prepareMaking()

Definition at line 95 of file matroskaattachment.cpp.

◆ parse()

void TagParser::MatroskaAttachment::parse ( EbmlElement attachedFileElement,
Diagnostics diag 
)

Parses attachment from the specified attachedFileElement.

Exceptions
Throwsstd::ios_base::failure when an IO error occurs.
ThrowsTagParser::Failure or a derived exception when a parsing error occurs.

Definition at line 30 of file matroskaattachment.cpp.

◆ prepareMaking()

MatroskaAttachmentMaker TagParser::MatroskaAttachment::prepareMaking ( Diagnostics diag)
inline

Prepares making.

Returns
Returns a MatroskaAttachmentMaker object which can be used to actually make the attachment.
Remarks
The attachment must NOT be mutated after making is prepared when it is intended to actually make the attachment using the make method of the returned object.
Exceptions
ThrowsTagParser::Failure or a derived exception when a making error occurs.

This method might be useful when it is necessary to know the size of the attachment before making it.

See also
make()

Definition at line 84 of file matroskaattachment.h.


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