mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Remove unused JsonValue <=> IPv4Address conversion code
This removes code that isn't used anywhere.
This commit is contained in:
@@ -181,11 +181,6 @@ JsonValue::JsonValue(const String& value)
|
||||
}
|
||||
}
|
||||
|
||||
JsonValue::JsonValue(const IPv4Address& value)
|
||||
: JsonValue(value.to_string())
|
||||
{
|
||||
}
|
||||
|
||||
JsonValue::JsonValue(const JsonObject& value)
|
||||
: m_type(Type::Object)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/IPv4Address.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
@@ -55,7 +54,6 @@ public:
|
||||
JsonValue(bool);
|
||||
JsonValue(const char*);
|
||||
JsonValue(const String&);
|
||||
JsonValue(const IPv4Address&);
|
||||
JsonValue(const JsonArray&);
|
||||
JsonValue(const JsonObject&);
|
||||
|
||||
@@ -85,13 +83,6 @@ public:
|
||||
return serialized<StringBuilder>();
|
||||
}
|
||||
|
||||
Optional<IPv4Address> to_ipv4_address() const
|
||||
{
|
||||
if (!is_string())
|
||||
return {};
|
||||
return IPv4Address::from_string(as_string());
|
||||
}
|
||||
|
||||
int to_int(int default_value = 0) const { return to_i32(default_value); }
|
||||
i32 to_i32(i32 default_value = 0) const { return to_number<i32>(default_value); }
|
||||
i64 to_i64(i64 default_value = 0) const { return to_number<i64>(default_value); }
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/IPv4Address.h>
|
||||
#include <AK/JsonArray.h>
|
||||
#include <AK/JsonObject.h>
|
||||
#include <AK/NumberFormat.h>
|
||||
|
||||
Reference in New Issue
Block a user