LibURL/Pattern: Implement matching a URLPattern

This commit is contained in:
Shannon Booth 2025-03-18 20:05:14 +13:00 committed by Tim Flynn
commit 6b1fa3ecd0
Notes: github-actions[bot] 2025-04-06 12:27:06 +00:00
3 changed files with 270 additions and 46 deletions

View file

@ -13,6 +13,7 @@
#include <LibURL/Pattern/Component.h>
#include <LibURL/Pattern/Init.h>
#include <LibURL/Pattern/PatternError.h>
#include <LibURL/URL.h>
namespace URL::Pattern {
@ -44,7 +45,7 @@ class Pattern {
public:
static PatternErrorOr<Pattern> create(Input const&, Optional<String> const& base_url = {}, IgnoreCase = IgnoreCase::No);
PatternErrorOr<Optional<Result>> match(Input const&, Optional<String> const& base_url_string) const;
PatternErrorOr<Optional<Result>> match(Variant<String, Init, URL> const&, Optional<String> const& base_url_string) const;
bool has_regexp_groups() const;