Add TagValue::isNull()

This commit is contained in:
Martchus 2019-06-01 22:55:16 +02:00
parent c28ded1bca
commit 7885b99f72
1 changed files with 21 additions and 2 deletions

View File

@ -89,6 +89,7 @@ public:
bool operator!=(const TagValue &other) const;
// methods
bool isNull() const;
bool isEmpty() const;
void clearData();
void clearMetadata();
@ -400,8 +401,26 @@ inline std::u16string TagValue::toWString(TagTextEncoding encoding) const
}
/*!
* \brief Returns an indication whether an value is assigned.
* \remarks Meta data such as description and MIME type is not considered as an assigned value.
* \brief Returns whether no value is assigned at all.
*
* Returns only true for default constructed instances or cleared instances (using TagValue::clearData()).
* So for empty strings, the integer 0, a TimeSpan of zero length, ... this function returns true.
*
* \remarks Meta-data such as description and MIME-type is not considered as an assigned value.
*/
inline bool TagValue::isNull() const
{
return m_ptr == nullptr;
}
/*!
* \brief Returns whether an empty value is assigned.
*
* An empty string and empty binary or picture data counts as empty so this function will return
* true for those. However, the integer 0, a TimeSpan of zero length, ... are not considered empty
* and this function will return false.
*
* \remarks Meta-data such as description and MIME-type is not considered as an assigned value.
*/
inline bool TagValue::isEmpty() const
{