mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Utilities/ifconfig: Replace uses of JsonObject::get_deprecated()/get_ptr
This commit is contained in:
parent
08c26e988a
commit
f63eaee20c
Notes:
sideshowbarker
2024-07-17 02:22:23 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/f63eaee20c Pull-request: https://github.com/SerenityOS/serenity/pull/16627 Reviewed-by: https://github.com/trflynn89
1 changed files with 10 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue