]> granicus.if.org Git - taglib/commitdiff
More cleanups and some API docs additions.
authorScott Wheeler <wheeler@kde.org>
Thu, 28 Oct 2004 22:05:43 +0000 (22:05 +0000)
committerScott Wheeler <wheeler@kde.org>
Thu, 28 Oct 2004 22:05:43 +0000 (22:05 +0000)
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@358636 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

ape/apeitem.cpp
ape/apeitem.h

index 90643ba5bbaf2f4a0434cc7ab30fc6f041176fe9..d4cca52d436c828cb686fb2b8843558c6a37ac04 100644 (file)
@@ -44,28 +44,28 @@ APE::Item::Item()
   d = new ItemPrivate;
 }
 
-APE::Item::Item(const String& key, const String& str)
+APE::Item::Item(const String &key, const String &s)
 {
   d = new ItemPrivate;
   d->key = key;
-  d->text.append(str);
+  d->text.append(s);
 }
 
-APE::Item::Item(const Itemitem)
+APE::Item::Item(const Item &item)
 {
   d = new ItemPrivate(*item.d);
 }
 
-Item &APE::Item::operator=(const Itemitem)
+Item &APE::Item::operator=(const Item &item)
 {
   delete d;
   d = new ItemPrivate(*item.d);
   return *this;
 }
 
-void APE::Item::setReadOnly(bool val)
+void APE::Item::setReadOnly(bool readOnly)
 {
-  d->readOnly = val;
+  d->readOnly = readOnly;
 }
 
 bool APE::Item::isReadOnly() const
@@ -135,10 +135,8 @@ void APE::Item::parse(const ByteVector& data)
   setReadOnly(flags & 1);
   setType(ItemTypes((flags >> 1) & 3));
 
-  if(int(d->type) < 2) {
-    ByteVectorList bl = ByteVectorList::split(d->value, '\0');
-    d->text = StringList(bl, String::UTF8);
-  }
+  if(int(d->type) < 2)
+    d->text = StringList(ByteVectorList::split(d->value, '\0'), String::UTF8);
 }
 
 ByteVector APE::Item::render()
@@ -164,7 +162,8 @@ ByteVector APE::Item::render() const
       value.append(it->data(String::UTF8));
     }
     d->value = value;
-  } else
+  }
+  else
     value.append(d->value);
 
   data.append(ByteVector::fromUInt(value.size(), false));
index 5953d8b5b2e351c90b12ab046f4df563768e0680..72226a9789c904047e1c1d0b62e769a83a2e1b95 100644 (file)
@@ -42,11 +42,11 @@ namespace TagLib {
        * Enum of types an Item can have. The value of 3 is reserved.
        */
       enum ItemTypes {
-        //! item contains text information coded in UTF-8
+        //! Item contains text information coded in UTF-8
         Text = 0,
-        //! item contains binary information
+        //! Item contains binary information
         Binary = 1,
-        //! item is a locator of external stored information
+        //! Item is a locator of external stored information
         Locator = 2
       };
       /*!
@@ -57,28 +57,35 @@ namespace TagLib {
       /*!
        * Constructs an item with \a key and \a value.
        */
-      Item(const String& key, const String& value);
+      Item(const String &key, const String &value);
 
       /*!
        * Constructs an item with \a key and \a values.
        */
-      Item(const String& key, const StringList& values);
+      Item(const String &key, const StringList &values);
 
-      Item(const Item&);
-      Item& operator=(const Item&);
+      /*!
+       * Construct an item as a copy of \a item.
+       */
+      Item(const Item &item);
+
+      /*!
+       * Copies the contents of \a item into this item.
+       */
+      Item &operator=(const Item &item);
 
       /*!
-       * Returns the key
+       * Returns the key.
        */
       String key() const;
 
       /*!
-       * Returns the binary value
+       * Returns the binary value.
        */
       ByteVector value() const;
 
       /*!
-       * Returns the size of the full item
+       * Returns the size of the full item.
        */
       int size() const;
 
@@ -99,22 +106,22 @@ namespace TagLib {
       ByteVector render();
 
       /*!
-       * Render the item to a ByteVector
+       * Render the item to a ByteVector.
        */
       ByteVector render() const;
 
       /*!
-       * Parse the item from the ByteVector \a data
+       * Parse the item from the ByteVector \a data.
        */
       void parse(const ByteVector& data);
 
       /*!
-       * Set the item to read-only
+       * Set the item to read-only.
        */
-      void setReadOnly(bool);
+      void setReadOnly(bool readOnly);
 
       /*!
-       * Returns if the item is read-only
+       * Return true if the item is read-only.
        */
       bool isReadOnly() const;