mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Handle empty strings in Json::Value::empty()
This commit is contained in:
committed by
Nik Bougalis
parent
e4f585b7fe
commit
a5a9242f4e
@@ -825,10 +825,15 @@ Value::size () const
|
||||
bool
|
||||
Value::empty () const
|
||||
{
|
||||
if ( isNull () || isArray () || isObject () )
|
||||
return size () == 0u;
|
||||
else
|
||||
return false;
|
||||
if (isNull ())
|
||||
return true;
|
||||
|
||||
if (isString ()) {
|
||||
auto s = asCString();
|
||||
return !(s && strlen(s));
|
||||
}
|
||||
|
||||
return (isArray () || isObject ()) && ! size ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user