json/tree: add as_bool native accessor
This commit is contained in:
parent
585a0b464c
commit
d102410567
@ -268,6 +268,15 @@ json::tree::node::as_null (void)
|
|||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool
|
||||||
|
json::tree::node::as_bool (void) const
|
||||||
|
{
|
||||||
|
return !!as_boolean ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
float
|
float
|
||||||
json::tree::node::as_float (void) const
|
json::tree::node::as_float (void) const
|
||||||
{
|
{
|
||||||
|
@ -70,6 +70,7 @@ namespace json { namespace tree {
|
|||||||
virtual boolean& as_boolean (void);
|
virtual boolean& as_boolean (void);
|
||||||
virtual null& as_null (void);
|
virtual null& as_null (void);
|
||||||
|
|
||||||
|
virtual bool as_bool (void) const;
|
||||||
virtual float as_float (void) const;
|
virtual float as_float (void) const;
|
||||||
virtual double as_double (void) const;
|
virtual double as_double (void) const;
|
||||||
virtual size_t as_uint (void) const;
|
virtual size_t as_uint (void) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user