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

#include <abstractattachment.h>

Inheritance diagram for TagParser::AbstractAttachment:
[legend]

Public Member Functions

const std::string & description () const
 Returns a description of the attachment. More...
 
void setDescription (const std::string &description)
 Sets a description of the attachment. More...
 
const std::string & name () const
 Returns the (file) name of the attachment. More...
 
void setName (const std::string &name)
 Sets the (file) name of the attachment. More...
 
const std::string & mimeType () const
 Returns the MIME-type of the attachment. More...
 
void setMimeType (const std::string &mimeType)
 Sets the MIME-type of the attachment. More...
 
uint64 id () const
 Returns the ID of the attachment. More...
 
void setId (const uint64 &id)
 Sets the ID of the attachment. More...
 
const StreamDataBlockdata () const
 Returns a reference to the data of the attachment. More...
 
void setData (std::unique_ptr< StreamDataBlock > &&data)
 Sets the data for the attachment. More...
 
void setFile (const std::string &path, Diagnostics &diag)
 Sets the data, name and MIME-type for the specified path. More...
 
bool isDataFromFile () const
 Returns whether the assigned data has been assigned using the setFile() method. More...
 
std::string label () const
 Returns a label for the track. More...
 
void clear ()
 Resets the object to its initial state. More...
 
bool isIgnored () const
 Returns whether the attachment is ignored/omitted when rewriting the container. More...
 
void setIgnored (bool ignored)
 Sets whether the attachment is ignored/omitted when rewriting the container. More...
 
bool isEmpty () const
 Returns whether the attachment is empty (no data and no meta-data assigned). More...
 

Protected Member Functions

 AbstractAttachment ()
 Constructs a new attachment. More...
 

Detailed Description

Definition at line 103 of file abstractattachment.h.

Constructor & Destructor Documentation

◆ AbstractAttachment()

TagParser::AbstractAttachment::AbstractAttachment ( )
inlineprotected

Constructs a new attachment.

Definition at line 139 of file abstractattachment.h.

Member Function Documentation

◆ clear()

void TagParser::AbstractAttachment::clear ( )

Resets the object to its initial state.

Definition at line 132 of file abstractattachment.cpp.

◆ data()

const StreamDataBlock * TagParser::AbstractAttachment::data ( ) const
inline

Returns a reference to the data of the attachment.

Remarks
  • The reference might be nullptr if there is no data assigned.
  • The attachment keeps ownership over the reference.
See also
setData(), setFile()

Definition at line 217 of file abstractattachment.h.

◆ description()

const std::string & TagParser::AbstractAttachment::description ( ) const
inline

Returns a description of the attachment.

Definition at line 149 of file abstractattachment.h.

◆ id()

uint64 TagParser::AbstractAttachment::id ( ) const
inline

Returns the ID of the attachment.

Definition at line 197 of file abstractattachment.h.

◆ isDataFromFile()

bool TagParser::AbstractAttachment::isDataFromFile ( ) const
inline

Returns whether the assigned data has been assigned using the setFile() method.

Definition at line 236 of file abstractattachment.h.

◆ isEmpty()

bool TagParser::AbstractAttachment::isEmpty ( ) const
inline

Returns whether the attachment is empty (no data and no meta-data assigned).

Remarks
Does not take into account whether an ID is set.

Definition at line 266 of file abstractattachment.h.

◆ isIgnored()

bool TagParser::AbstractAttachment::isIgnored ( ) const
inline

Returns whether the attachment is ignored/omitted when rewriting the container.

The default value is false.

See also
setIgnored()

Definition at line 247 of file abstractattachment.h.

◆ label()

string TagParser::AbstractAttachment::label ( ) const

Returns a label for the track.

Definition at line 116 of file abstractattachment.cpp.

◆ mimeType()

const std::string & TagParser::AbstractAttachment::mimeType ( ) const
inline

Returns the MIME-type of the attachment.

Definition at line 181 of file abstractattachment.h.

◆ name()

const std::string & TagParser::AbstractAttachment::name ( ) const
inline

Returns the (file) name of the attachment.

Definition at line 165 of file abstractattachment.h.

◆ setData()

void TagParser::AbstractAttachment::setData ( std::unique_ptr< StreamDataBlock > &&  data)
inline

Sets the data for the attachment.

Remarks
The specified data is moved to the attachment.
See also
data(), setFile()

Definition at line 227 of file abstractattachment.h.

◆ setDescription()

void TagParser::AbstractAttachment::setDescription ( const std::string &  description)
inline

Sets a description of the attachment.

Definition at line 157 of file abstractattachment.h.

◆ setFile()

void TagParser::AbstractAttachment::setFile ( const std::string &  path,
Diagnostics diag 
)

Sets the data, name and MIME-type for the specified path.

A stream for the file with the specified path is opened (read-only). This stream will be freed by the attachment if the other data is assigned or the attachment gets destroyed.

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

When such an exception is thrown, the attachment remains unchanged.

Definition at line 154 of file abstractattachment.cpp.

◆ setId()

void TagParser::AbstractAttachment::setId ( const uint64 &  id)
inline

Sets the ID of the attachment.

Definition at line 205 of file abstractattachment.h.

◆ setIgnored()

void TagParser::AbstractAttachment::setIgnored ( bool  ignored)
inline

Sets whether the attachment is ignored/omitted when rewriting the container.

See also
isIgnored()

Definition at line 257 of file abstractattachment.h.

◆ setMimeType()

void TagParser::AbstractAttachment::setMimeType ( const std::string &  mimeType)
inline

Sets the MIME-type of the attachment.

Definition at line 189 of file abstractattachment.h.

◆ setName()

void TagParser::AbstractAttachment::setName ( const std::string &  name)
inline

Sets the (file) name of the attachment.

Definition at line 173 of file abstractattachment.h.


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