MCPcopy Create free account
hub / github.com/NativeScript/android / get_host

Method get_host

test-app/runtime/src/main/cpp/ada/ada.cpp:12633–12645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12631}
12632
12633[[nodiscard]] std::string url::get_host() const noexcept {
12634 // If url's host is null, then return the empty string.
12635 // If url's port is null, return url's host, serialized.
12636 // Return url's host, serialized, followed by U+003A (:) and url's port,
12637 // serialized.
12638 if (!host.has_value()) {
12639 return "";
12640 }
12641 if (port.has_value()) {
12642 return host.value() + ":" + get_port();
12643 }
12644 return host.value();
12645}
12646
12647[[nodiscard]] std::string url::get_hostname() const noexcept {
12648 return host.value_or("");

Callers 4

GetHostMethod · 0.80
get_originMethod · 0.80
parse_url_implFunction · 0.80
ada_get_hostFunction · 0.80

Calls 2

valueMethod · 0.80
has_valueMethod · 0.45

Tested by

no test coverage detected