d->text = values;
}
-APE::Item::Item(const String &key, const ByteVector &value)
+APE::Item::Item(const String &key, const ByteVector &value, bool binary)
{
d = new ItemPrivate;
- d->type = Binary;
d->key = key;
- d->value = value;
+ if(binary) {
+ d->type = Binary;
+ d->value = value;
+ }
+ else
+ d->text.append(value);
}
APE::Item::Item(const Item &item)
Item(const String &key, const StringList &values);
/*!
- * Constructs a binary item with \a key and \a value.
+ * Constructs an item with \a key and \a value.
+ * If \a binary is true a Binary item will be created, otherwise \a value will be interpreted as text
*/
- Item(const String &key, const ByteVector &value);
+ Item(const String &key, const ByteVector &value, bool binary);
/*!
* Construct an item as a copy of \a item.
{
removeItem(key);
if(!key.isEmpty() && !value.isEmpty())
- setItem(key, Item(key, value));
+ setItem(key, Item(key, value, true));
}
void APE::Tag::setItem(const String &key, const Item &item)