mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-16 18:56:52 +02:00
Added empty() operator-bang and isNull()
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user