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

Method set_search

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

Source from the content-addressed store, hash-verified

12868}
12869
12870void url::set_search(const std::string_view input) {
12871 if (input.empty()) {
12872 query = std::nullopt;
12873 helpers::strip_trailing_spaces_from_opaque_path(*this);
12874 return;
12875 }
12876
12877 std::string new_value;
12878 new_value = input[0] == '?' ? input.substr(1) : input;
12879 helpers::remove_ascii_tab_or_newline(new_value);
12880
12881 auto query_percent_encode_set =
12882 is_special() ? ada::character_sets::SPECIAL_QUERY_PERCENT_ENCODE
12883 : ada::character_sets::QUERY_PERCENT_ENCODE;
12884
12885 query = ada::unicode::percent_encode(new_value, query_percent_encode_set);
12886}
12887
12888bool url::set_pathname(const std::string_view input) {
12889 if (has_opaque_path) {

Callers 3

SetSearchMethod · 0.80
canonicalize_searchFunction · 0.80
ada_set_searchFunction · 0.80

Calls 6

is_specialFunction · 0.85
percent_encodeFunction · 0.85
overlapsFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected