NBT: Bool operator

This commit is contained in:
DankParrot 2020-08-12 18:50:49 -07:00
parent a46ad28499
commit 935d29a30d
2 changed files with 7 additions and 0 deletions

View File

@ -137,6 +137,11 @@ namespace NBT
return nbt_dump_ascii(m_node);
}
Tag::operator bool() const
{
return m_node != NULL && m_node->type != TAG_INVALID;
}
std::ostream& operator<<(std::ostream& stream, const Tag& tag)
{
return stream << tag.ToString();

View File

@ -45,6 +45,8 @@ namespace NBT
const DataBuffer GetData() const;
const char* ToString() const;
operator bool() const;
};
// Operator overload for ostream