mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
AK: Add JsonValue::to_bool().
This commit is contained in:
parent
56563cb305
commit
5b19911025
Notes:
sideshowbarker
2024-07-19 13:22:10 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5b199110253
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…
Reference in a new issue