Add a simple function for checking for membership in the fieldListMap.

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@572680 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Scott Wheeler 2006-08-13 15:19:36 +00:00
parent 71a392fe81
commit 953b8a119a
2 changed files with 12 additions and 0 deletions

View File

@ -205,6 +205,11 @@ void Ogg::XiphComment::removeField(const String &key, const String &value)
d->fieldListMap[key].clear();
}
bool Ogg::XiphComment::contains(const String &key) const
{
return d->fieldListMap.contains(key) && !d->fieldListMap[key].isEmpty();
}
ByteVector Ogg::XiphComment::render() const
{
return render(true);

View File

@ -156,6 +156,13 @@ namespace TagLib {
*/
void removeField(const String &key, const String &value = String::null);
/*!
* Returns true if the field is contained within the comment.
*
* \note This is safer than checking for membership in the FieldListMap.
*/
bool contains(const String &key) const;
/*!
* Renders the comment to a ByteVector suitable for inserting into a file.
*/