TagLib API Documentation
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
TagLib::ID3v2::AttachedPictureFrame Class Reference

An ID3v2 attached picture frame implementation. More...

#include <attachedpictureframe.h>

Inheritance diagram for TagLib::ID3v2::AttachedPictureFrame:
Collaboration diagram for TagLib::ID3v2::AttachedPictureFrame:

Public Member Functions

 AttachedPictureFrame ()
 AttachedPictureFrame (const ByteVector &data)
 ~AttachedPictureFrame () override
 AttachedPictureFrame (const AttachedPictureFrame &)=delete
AttachedPictureFrameoperator= (const AttachedPictureFrame &)=delete
String toString () const override
StringList toStringList () const override
String::Type textEncoding () const
void setTextEncoding (String::Type t)
String mimeType () const
void setMimeType (const String &m)
Type type () const
void setType (Type t)
String description () const
void setDescription (const String &desc)
ByteVector picture () const
void setPicture (const ByteVector &p)
- Public Member Functions inherited from TagLib::ID3v2::Frame
virtual ~Frame ()
 Frame (const Frame &)=delete
Frameoperator= (const Frame &)=delete
ByteVector frameID () const
unsigned int size () const
unsigned int headerSize () const
void setData (const ByteVector &data)
virtual void setText (const String &text)
virtual String toString () const =0
virtual StringList toStringList () const
ByteVector render () const
Headerheader () const
 Header (const ByteVector &data, unsigned int version=4)
virtual ~Header ()
 Header (const Header &)=delete
Headeroperator= (const Header &)=delete
void setData (const ByteVector &data, unsigned int version=4)
ByteVector frameID () const
void setFrameID (const ByteVector &id)
unsigned int frameSize () const
void setFrameSize (unsigned int size)
unsigned int version () const
void setVersion (unsigned int version)
unsigned int size () const
bool tagAlterPreservation () const
void setTagAlterPreservation (bool preserve)
bool fileAlterPreservation () const
bool readOnly () const
bool groupingIdentity () const
bool compression () const
bool encryption () const
bool unsynchronisation () const
bool dataLengthIndicator () const
ByteVector render () const

Protected Member Functions

void parseFields (const ByteVector &data) override
ByteVector renderFields () const override
- Protected Member Functions inherited from TagLib::ID3v2::Frame
 Frame (const ByteVector &data)
 Frame (Header *h)
void setHeader (Header *h, bool deleteCurrent=true)
void parse (const ByteVector &data)
virtual void parseFields (const ByteVector &data)=0
virtual ByteVector renderFields () const =0
ByteVector fieldData (const ByteVector &frameData) const
String readStringField (const ByteVector &data, String::Type encoding, int *position=nullptr)
String::Type checkTextEncoding (const StringList &fields, String::Type encoding) const
virtual PropertyMap asProperties () const

Protected Attributes

TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE std::unique_ptr< AttachedPictureFramePrivate > d


class FrameFactory

Additional Inherited Members

- Static Public Member Functions inherited from TagLib::ID3v2::Frame
static ByteVector textDelimiter (String::Type t)
static ByteVector keyToFrameID (const String &)
static String frameIDToKey (const ByteVector &)
- Static Public Attributes inherited from TagLib::ID3v2::Frame
static const String instrumentPrefix
static const String commentPrefix
static const String lyricsPrefix
static const String urlPrefix
- Static Protected Member Functions inherited from TagLib::ID3v2::Frame
static void splitProperties (const PropertyMap &original, PropertyMap &singleFrameProperties, PropertyMap &tiplProperties, PropertyMap &tmclProperties)

Detailed Description

An ID3v2 attached picture frame implementation.

This is an implementation of ID3v2 attached pictures. Pictures may be included in tags, one per APIC frame (but there may be multiple APIC frames in a single tag). These pictures are usually in either JPEG or PNG format.

Constructor & Destructor Documentation

◆ AttachedPictureFrame() [1/3]

TagLib::ID3v2::AttachedPictureFrame::AttachedPictureFrame ( )

Constructs an empty picture frame. The description, content and text encoding should be set manually.

◆ AttachedPictureFrame() [2/3]

TagLib::ID3v2::AttachedPictureFrame::AttachedPictureFrame ( const ByteVector data)

Constructs an AttachedPicture frame based on data.

◆ ~AttachedPictureFrame()

TagLib::ID3v2::AttachedPictureFrame::~AttachedPictureFrame ( )

Destroys the AttachedPictureFrame instance.

◆ AttachedPictureFrame() [3/3]

TagLib::ID3v2::AttachedPictureFrame::AttachedPictureFrame ( const AttachedPictureFrame )

Member Function Documentation

◆ description()

String TagLib::ID3v2::AttachedPictureFrame::description ( ) const

Returns a text description of the image.

See also

◆ mimeType()

String TagLib::ID3v2::AttachedPictureFrame::mimeType ( ) const

Returns the mime type of the image. This should in most cases be "image/png" or "image/jpeg".

◆ operator=()

AttachedPictureFrame & TagLib::ID3v2::AttachedPictureFrame::operator= ( const AttachedPictureFrame )

◆ parseFields()

void TagLib::ID3v2::AttachedPictureFrame::parseFields ( const ByteVector data)

Called by parse() to parse the field data. It makes this information available through the public API. This must be overridden by the subclasses.

Implements TagLib::ID3v2::Frame.

Reimplemented in TagLib::ID3v2::AttachedPictureFrameV22.

◆ picture()

ByteVector TagLib::ID3v2::AttachedPictureFrame::picture ( ) const

Returns the image data as a ByteVector.

ByteVector has a data() method that returns a const char * which should make it easy to export this data to external programs.
See also

◆ renderFields()

ByteVector TagLib::ID3v2::AttachedPictureFrame::renderFields ( ) const

Render the field data back to a binary format in a ByteVector. This must be overridden by subclasses.

Implements TagLib::ID3v2::Frame.

◆ setDescription()

void TagLib::ID3v2::AttachedPictureFrame::setDescription ( const String desc)

Sets a textual description of the image to desc.

See also

◆ setMimeType()

void TagLib::ID3v2::AttachedPictureFrame::setMimeType ( const String m)

Sets the mime type of the image. This should in most cases be "image/png" or "image/jpeg".

◆ setPicture()

void TagLib::ID3v2::AttachedPictureFrame::setPicture ( const ByteVector p)

Sets the image data to p. p should be of the type specified in this frame's mime-type specification.

See also

◆ setTextEncoding()

void TagLib::ID3v2::AttachedPictureFrame::setTextEncoding ( String::Type  t)

Set the text encoding used for the description.

See also

◆ setType()

void TagLib::ID3v2::AttachedPictureFrame::setType ( Type  t)

Sets the type for the image.

See also

◆ textEncoding()

String::Type TagLib::ID3v2::AttachedPictureFrame::textEncoding ( ) const

Returns the text encoding used for the description.

See also

◆ toString()

String TagLib::ID3v2::AttachedPictureFrame::toString ( ) const

Returns a string containing the description and mime-type

Implements TagLib::ID3v2::Frame.

◆ toStringList()

StringList TagLib::ID3v2::AttachedPictureFrame::toStringList ( ) const

Returns a string list containing the description and mime-type.

Reimplemented from TagLib::ID3v2::Frame.

◆ type()

Type TagLib::ID3v2::AttachedPictureFrame::type ( ) const

Returns the type of the image.

See also

Friends And Related Function Documentation

◆ FrameFactory

friend class FrameFactory

Member Data Documentation

◆ d

TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE std::unique_ptr<AttachedPictureFramePrivate> TagLib::ID3v2::AttachedPictureFrame::d

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