ByteVector APE::Item::value() const
{
+ // This seems incorrect as it won't be actually rendering the value to keep it
+ // up to date.
+
return d->value;
}
+void APE::Item::setKey(const String &key)
+{
+ d->key = key;
+}
+
+void APE::Item::setValue(const String &value)
+{
+ d->text = value;
+}
+
+void APE::Item::setValues(const StringList &value)
+{
+ d->text = value;
+}
+
+void APE::Item::appendValue(const String &value)
+{
+ d->text.append(value);
+}
+
+void APE::Item::appendValues(const StringList &values)
+{
+ d->text.append(values);
+}
+
int APE::Item::size() const
{
return 8 + d->key.size() + 1 + d->value.size();
/*!
* Returns the binary value.
+ *
+ * \deprecated This will be removed in the next binary incompatible version
+ * as it is not kept in sync with the things that are set using setValue()
+ * and friends.
*/
ByteVector value() const;
+ /*!
+ * Sets the key for the item to \a key.
+ */
+ void setKey(const String &key);
+
+ /*!
+ * Sets the value of the item to \a value and clears any previous contents.
+ *
+ * \see toString()
+ */
+ void setValue(const String &value);
+
+ /*!
+ * Sets the value of the item to the list of values in \a value and clears
+ * any previous contents.
+ *
+ * \see toStringList()
+ */
+ void setValues(const StringList &values);
+
+ /*!
+ * Appends \a value to create (or extend) the current list of values.
+ *
+ * \see toString()
+ */
+ void appendValue(const String &value);
+
+ /*!
+ * Appends \a values to extend the current list of values.
+ *
+ * \see toStringList()
+ */
+ void appendValues(const StringList &values);
+
/*!
* Returns the size of the full item.
*/
removeItem(key);
if(!value.isEmpty()) {
if(d->itemListMap.contains(key) || !replace)
- d->itemListMap[key.upper()].toStringList().append(value);
+ d->itemListMap[key.upper()].appendValue(value);
else
setItem(key, Item(key, value));
}