mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
AK: Add JsonValue::to_bool().
This commit is contained in:
parent
56563cb305
commit
5b19911025
1 changed files with 7 additions and 0 deletions
|
@ -67,6 +67,13 @@ public:
|
||||||
return IPv4Address::from_string(as_string());
|
return IPv4Address::from_string(as_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool to_bool(bool default_value = false) const
|
||||||
|
{
|
||||||
|
if (!is_bool())
|
||||||
|
return default_value;
|
||||||
|
return as_bool();
|
||||||
|
}
|
||||||
|
|
||||||
int as_int() const
|
int as_int() const
|
||||||
{
|
{
|
||||||
ASSERT(is_int());
|
ASSERT(is_int());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue