Add TagValue::isNull()
This commit is contained in:
parent
c28ded1bca
commit
7885b99f72
23
tagvalue.h
23
tagvalue.h
|
@ -89,6 +89,7 @@ public:
|
||||||
bool operator!=(const TagValue &other) const;
|
bool operator!=(const TagValue &other) const;
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
|
bool isNull() const;
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
void clearData();
|
void clearData();
|
||||||
void clearMetadata();
|
void clearMetadata();
|
||||||
|
@ -400,8 +401,26 @@ inline std::u16string TagValue::toWString(TagTextEncoding encoding) const
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns an indication whether an value is assigned.
|
* \brief Returns whether no value is assigned at all.
|
||||||
* \remarks Meta data such as description and MIME type is not considered as an assigned value.
|
*
|
||||||
|
* 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
|
inline bool TagValue::isEmpty() const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue