]> granicus.if.org Git - taglib/commitdiff
Add accessors for the image description.
authorScott Wheeler <wheeler@kde.org>
Thu, 21 Jul 2005 17:27:37 +0000 (17:27 +0000)
committerScott Wheeler <wheeler@kde.org>
Thu, 21 Jul 2005 17:27:37 +0000 (17:27 +0000)
BUG:94258

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@437378 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

mpeg/id3v2/frames/attachedpictureframe.cpp
mpeg/id3v2/frames/attachedpictureframe.h

index 5700dfe6466537c6ee7c17b223d9e7c56ad69df5..945d7a61a1c6691413fa31ce2acab96102e8a443 100644 (file)
@@ -95,6 +95,16 @@ void AttachedPictureFrame::setType(Type t)
   d->type = t;
 }
 
+String AttachedPictureFrame::description() const
+{
+  return d->description;
+}
+
+void AttachedPictureFrame::setDescription(const String &desc)
+{
+  d->description = desc;
+}
+
 ByteVector AttachedPictureFrame::picture() const
 {
   return d->data;
@@ -122,8 +132,10 @@ void AttachedPictureFrame::parseFields(const ByteVector &data)
   pos += 1;
 
   int offset = data.find(textDelimiter(String::Latin1), pos);
+
   if(offset < pos)
     return;
+
   d->mimeType = String(data.mid(pos, offset - pos), String::Latin1);
   pos = offset + 1;
 
@@ -131,8 +143,10 @@ void AttachedPictureFrame::parseFields(const ByteVector &data)
   pos += 1;
 
   offset = data.find(textDelimiter(d->textEncoding), pos);
+
   if(offset < pos)
     return;  
+
   d->description = String(data.mid(pos, offset - pos), d->textEncoding);
   pos = offset + 1;
 
index 896f00217ebc6f6e5ca26d7af9fd570b3755c914..2cb2444fdf47a1b1e819cd5d07079e4010953b51 100644 (file)
@@ -156,6 +156,26 @@ namespace TagLib {
        */
       void setType(Type t);
 
+      /*!
+       * Returns a text description of the image.
+       *
+       * \see setDescription()
+       * \see textEncoding()
+       * \see setTextEncoding()
+       */
+
+      String description() const;
+
+      /*!
+       * Sets a textual description of the image to \a desc.
+       *
+       * \see description()
+       * \see textEncoding()
+       * \see setTextEncoding()
+       */
+
+      void setDescription(const String &desc);
+
       /*!
        * Returns the image data as a ByteVector.
        *