mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Add IsInit() function
This commit is contained in:
@ -42,6 +42,12 @@ namespace NSJSON
|
||||
return m_internal->m_type == CTypedValue::vtNull;
|
||||
}
|
||||
|
||||
bool IValue::IsInit() const
|
||||
{
|
||||
// the same as (m_internal->m_type != CTypedValue::vtUndefined && m_internal->m_type != CTypedValue::vtNull) but a little bit faster
|
||||
return m_internal->m_value.get() != nullptr;
|
||||
}
|
||||
|
||||
bool IValue::IsBool() const
|
||||
{
|
||||
return (m_internal->m_type == CTypedValue::vtPrimitive &&
|
||||
|
||||
@ -50,6 +50,10 @@ namespace NSJSON
|
||||
* Returns true if the value is null.
|
||||
*/
|
||||
bool IsNull() const;
|
||||
/**
|
||||
* Returns true if the value is not undefined or null.
|
||||
*/
|
||||
bool IsInit() const;
|
||||
/**
|
||||
* Returns true if the value is a boolean value.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user