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

Function canonicalize_username

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

Source from the content-addressed store, hash-verified

16095}
16096
16097tl::expected<std::string, errors> canonicalize_username(
16098 std::string_view input) {
16099 // If value is the empty string, return value.
16100 if (input.empty()) [[unlikely]] {
16101 return "";
16102 }
16103 // Let dummyURL be a new URL record.
16104 auto url = ada::parse<url_aggregator>("fake://dummy.test", nullptr);
16105 ADA_ASSERT_TRUE(url.has_value());
16106 // Set the username given dummyURL and value.
16107 if (!url->set_username(input)) {
16108 return tl::unexpected(errors::type_error);
16109 }
16110 // Return dummyURL's username.
16111 return std::string(url->get_username());
16112}
16113
16114tl::expected<std::string, errors> canonicalize_password(
16115 std::string_view input) {

Callers 1

process_usernameMethod · 0.85

Calls 5

unexpectedClass · 0.85
set_usernameMethod · 0.80
get_usernameMethod · 0.60
emptyMethod · 0.45
has_valueMethod · 0.45

Tested by

no test coverage detected