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

Function is_absolute_pathname

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

Source from the content-addressed store, hash-verified

16695}
16696
16697constexpr bool is_absolute_pathname(
16698 std::string_view input, url_pattern_init::process_type type) noexcept {
16699 // If input is the empty string, then return false.
16700 if (input.empty()) [[unlikely]] {
16701 return false;
16702 }
16703 // If input[0] is U+002F (/), then return true.
16704 if (input.starts_with("/")) return true;
16705 // If type is "url", then return false.
16706 if (type == url_pattern_init::process_type::url) return false;
16707 // If input's code point length is less than 2, then return false.
16708 if (input.size() < 2) return false;
16709 // If input[0] is U+005C (\) and input[1] is U+002F (/), then return true.
16710 // If input[0] is U+007B ({) and input[1] is U+002F (/), then return true.
16711 // Return false.
16712 return input[1] == '/' && (input[0] == '\\' || input[0] == '{');
16713}
16714
16715std::string generate_pattern_string(
16716 std::vector<url_pattern_part>& part_list,

Callers 1

processMethod · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected