MCPcopy Create free account
hub / github.com/ada-url/ada / process_pathname

Method process_pathname

src/url_pattern.cpp:319–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317}
318
319tl::expected<std::string, errors> url_pattern_init::process_pathname(
320 std::string_view value, std::string_view protocol, process_type type) {
321 // If type is "pattern" then return pathnameValue.
322 if (type == process_type::pattern) {
323 return std::string(value);
324 }
325
326 // If protocolValue is a special scheme or the empty string, then return the
327 // result of running canonicalize a pathname given pathnameValue.
328 if (protocol.empty() || scheme::is_special(protocol)) {
329 return url_pattern_helpers::canonicalize_pathname(value);
330 }
331
332 // Return the result of running canonicalize an opaque pathname given
333 // pathnameValue.
334 return url_pattern_helpers::canonicalize_opaque_pathname(value);
335}
336
337tl::expected<std::string, errors> url_pattern_init::process_search(
338 std::string_view value, process_type type) {

Callers

nothing calls this directly

Calls 3

is_specialFunction · 0.85
canonicalize_pathnameFunction · 0.85

Tested by

no test coverage detected