Preserve source code backward compatibility

This commit is contained in:
Stephen F. Booth
2012-04-10 18:06:58 -04:00
parent ca26a9ad3e
commit 32a4ac6599
3 changed files with 11 additions and 6 deletions

View File

@ -62,12 +62,16 @@ APE::Item::Item(const String &key, const StringList &values)
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)

View File

@ -70,9 +70,10 @@ namespace TagLib {
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.

View File

@ -294,7 +294,7 @@ void APE::Tag::setData(const String &key, const ByteVector &value)
{
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)