Utilities/ifconfig: Replace uses of JsonObject::get_deprecated()/get_ptr

This commit is contained in:
Sam Atkins 2022-12-22 14:27:48 +00:00 committed by Tim Flynn
parent 08c26e988a
commit f63eaee20c
Notes: sideshowbarker 2024-07-17 02:22:23 +09:00

View file

@ -38,16 +38,16 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
json.as_array().for_each([](auto& value) {
auto& if_object = value.as_object();
auto name = if_object.get_deprecated("name"sv).to_deprecated_string();
auto class_name = if_object.get_deprecated("class_name"sv).to_deprecated_string();
auto mac_address = if_object.get_deprecated("mac_address"sv).to_deprecated_string();
auto ipv4_address = if_object.get_deprecated("ipv4_address"sv).to_deprecated_string();
auto netmask = if_object.get_deprecated("ipv4_netmask"sv).to_deprecated_string();
auto packets_in = if_object.get_deprecated("packets_in"sv).to_u32();
auto bytes_in = if_object.get_deprecated("bytes_in"sv).to_u32();
auto packets_out = if_object.get_deprecated("packets_out"sv).to_u32();
auto bytes_out = if_object.get_deprecated("bytes_out"sv).to_u32();
auto mtu = if_object.get_deprecated("mtu"sv).to_u32();
auto name = if_object.get_deprecated_string("name"sv).value_or({});
auto class_name = if_object.get_deprecated_string("class_name"sv).value_or({});
auto mac_address = if_object.get_deprecated_string("mac_address"sv).value_or({});
auto ipv4_address = if_object.get_deprecated_string("ipv4_address"sv).value_or({});
auto netmask = if_object.get_deprecated_string("ipv4_netmask"sv).value_or({});
auto packets_in = if_object.get_u32("packets_in"sv).value_or(0);
auto bytes_in = if_object.get_u32("bytes_in"sv).value_or(0);
auto packets_out = if_object.get_u32("packets_out"sv).value_or(0);
auto bytes_out = if_object.get_u32("bytes_out"sv).value_or(0);
auto mtu = if_object.get_u32("mtu"sv).value_or(0);
outln("{}:", name);
outln("\tmac: {}", mac_address);