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

Method get_href

test-app/runtime/src/main/cpp/ada/ada.h:6774–6804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6772}
6773
6774[[nodiscard]] ada_really_inline std::string url::get_href() const noexcept {
6775 std::string output = get_protocol();
6776
6777 if (host.has_value()) {
6778 output += "//";
6779 if (has_credentials()) {
6780 output += username;
6781 if (!password.empty()) {
6782 output += ":" + get_password();
6783 }
6784 output += "@";
6785 }
6786 output += host.value();
6787 if (port.has_value()) {
6788 output += ":" + get_port();
6789 }
6790 } else if (!has_opaque_path && path.starts_with("//")) {
6791 // If url's host is null, url does not have an opaque path, url's path's
6792 // size is greater than 1, and url's path[0] is the empty string, then
6793 // append U+002F (/) followed by U+002E (.) to output.
6794 output += "/.";
6795 }
6796 output += path;
6797 if (query.has_value()) {
6798 output += "?" + query.value();
6799 }
6800 if (hash.has_value()) {
6801 output += "#" + hash.value();
6802 }
6803 return output;
6804}
6805
6806ada_really_inline size_t url::parse_port(std::string_view view,
6807 bool check_trailing_content) noexcept {

Callers 4

GetHrefMethod · 0.80
ToStringMethod · 0.80
parse_url_implFunction · 0.80
ada_get_hrefFunction · 0.80

Calls 3

valueMethod · 0.80
has_valueMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected