Tag Parser 12.4.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
|
The AbstractAttachment class parses and stores attachment information. More...
#include <abstractattachment.h>
Public Member Functions | |
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 StreamDataBlock * | data () 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). | |
Protected Member Functions | |
AbstractAttachment () | |
Constructs a new attachment. | |
virtual | ~AbstractAttachment () |
Destroys the attachment. | |
The AbstractAttachment class parses and stores attachment information.
|
explicitprotected |
Constructs a new attachment.
Definition at line 136 of file abstractattachment.cpp.
|
protectedvirtual |
Destroys the attachment.
Definition at line 146 of file abstractattachment.cpp.
void TagParser::AbstractAttachment::clear | ( | ) |
Resets the object to its initial state.
Definition at line 169 of file abstractattachment.cpp.
|
inline |
Returns a reference to the data of the attachment.
Definition at line 213 of file abstractattachment.h.
|
inline |
Returns a description of the attachment.
Definition at line 145 of file abstractattachment.h.
|
inline |
Returns the ID of the attachment.
Definition at line 193 of file abstractattachment.h.
|
inline |
Returns whether the assigned data has been assigned using the setFile() method.
Definition at line 232 of file abstractattachment.h.
|
inline |
Returns whether the attachment is empty (no data and no meta-data assigned).
Definition at line 262 of file abstractattachment.h.
|
inline |
Returns whether the attachment is ignored/omitted when rewriting the container.
The default value is false.
Definition at line 243 of file abstractattachment.h.
string TagParser::AbstractAttachment::label | ( | ) | const |
Returns a label for the track.
Definition at line 153 of file abstractattachment.cpp.
|
inline |
Returns the MIME-type of the attachment.
Definition at line 177 of file abstractattachment.h.
|
inline |
Returns the (file) name of the attachment.
Definition at line 161 of file abstractattachment.h.
|
inline |
Sets the data for the attachment.
Definition at line 223 of file abstractattachment.h.
|
inline |
Sets a description of the attachment.
Definition at line 153 of file abstractattachment.h.
void TagParser::AbstractAttachment::setFile | ( | std::string_view | path, |
Diagnostics & | diag, | ||
AbortableProgressFeedback & | progress ) |
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.
Throws | std::ios_base::failure when an IO error occurs. |
Throws | TagParser::Failure or a derived class when a parsing error occurs. |
When such an exception is thrown, the attachment remains unchanged.
Definition at line 191 of file abstractattachment.cpp.
|
inline |
Sets the ID of the attachment.
Definition at line 201 of file abstractattachment.h.
|
inline |
Sets whether the attachment is ignored/omitted when rewriting the container.
Definition at line 253 of file abstractattachment.h.
|
inline |
Sets the MIME-type of the attachment.
Definition at line 185 of file abstractattachment.h.
|
inline |
Sets the (file) name of the attachment.
Definition at line 169 of file abstractattachment.h.