Added empty() operator-bang and isNull()

This commit is contained in:
Christopher Dunn
2007-03-23 08:55:25 +00:00
parent 1aa20f9e58
commit 208a781e47
2 changed files with 33 additions and 1 deletions

View File

@@ -888,6 +888,23 @@ Value::size() const
}
bool
Value::empty() const
{
if ( isNull() || isArray() || isObject() )
return size() == 0u;
else
return false;
}
bool
Value::operator!() const
{
return isNull();
}
void
Value::clear()
{
@@ -1217,6 +1234,13 @@ Value::getMemberNames() const
//# endif
bool
Value::isNull() const
{
return type_ == nullValue;
}
bool
Value::isBool() const
{