chromium/third_party/liburlpattern/constructor_string_parser.h

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by an MIT-style license that can be
// found in the LICENSE file or at https://opensource.org/licenses/MIT.

#ifndef THIRD_PARTY_LIBURLPATTERN_CONSTRUCTOR_STRING_PARSER_H_
#define THIRD_PARTY_LIBURLPATTERN_CONSTRUCTOR_STRING_PARSER_H_

#include <functional>
#include <optional>
#include <string_view>

#include "base/component_export.h"
#include "third_party/abseil-cpp/absl/status/status.h"
#include "third_party/liburlpattern/tokenize.h"

namespace liburlpattern {

// A helper class to parse the first string passed to the URLPattern
// constructor.  In general the parser works by using the liburlpattern
// tokenizer to first split up the input into pattern tokens.  It can
// then look through the tokens to find non-special characters that match
// the different URL component separators.  Each component is then split
// off and stored in a `Result` object that can be accessed via `GetResult()`.
// The intent is that this object should then be processed as if it was passed
// into the constructor itself.
class COMPONENT_EXPORT(LIBURLPATTERN) ConstructorStringParser {};

}  // namespace liburlpattern

#endif  // THIRD_PARTY_LIBURLPATTERN_CONSTRUCTOR_STRING_PARSER_H_