Loading...
Searching...
No Matches
parser.h
Go to the documentation of this file.
#ifndef ADA_PARSER_H
#define ADA_PARSER_H
#include <string_view>
#include <variant>
#include "ada/expected.h"
#include "ada/url_pattern_regex.h"
#include "ada/url_pattern_init.h"
namespace ada {
struct url_aggregator;
struct url;
#if ADA_INCLUDE_URL_PATTERN
template <url_pattern_regex::regex_concept regex_provider>
class url_pattern;
struct url_pattern_options;
#endif // ADA_INCLUDE_URL_PATTERN
enum class errors : uint8_t;
} // namespace ada
namespace ada::parser {
template <typename result_type = url_aggregator>
result_type parse_url(std::string_view user_input,
const result_type* base_url = nullptr);
extern template url_aggregator parse_url<url_aggregator>(
std::string_view user_input, const url_aggregator* base_url);
extern template url parse_url<url>(std::string_view user_input,
const url* base_url);
template <typename result_type = url_aggregator, bool store_values = true>
result_type parse_url_impl(std::string_view user_input,
const result_type* base_url = nullptr);
extern template url_aggregator parse_url_impl<url_aggregator>(
std::string_view user_input, const url_aggregator* base_url);
extern template url parse_url_impl<url>(std::string_view user_input,
const url* base_url);
#if ADA_INCLUDE_URL_PATTERN
template <url_pattern_regex::regex_concept regex_provider>
tl::expected<url_pattern<regex_provider>, errors> parse_url_pattern_impl(
std::variant<std::string_view, url_pattern_init>&& input,
const std::string_view* base_url, const url_pattern_options* options);
#endif // ADA_INCLUDE_URL_PATTERN
} // namespace ada::parser
#endif // ADA_PARSER_H
ada::parser
Internal URL parsing implementation.
Definition parser-inl.h:16
ada::parser::parse_url< url >
template url parse_url< url >(std::string_view user_input, const url *base_url)
ada::parser::parse_url
result_type parse_url(std::string_view user_input, const result_type *base_url=nullptr)
Definition parser.cpp:935
ada::parser::parse_url_impl< url >
template url parse_url_impl< url >(std::string_view user_input, const url *base_url)
ada::parser::parse_url_impl< url_aggregator >
template url_aggregator parse_url_impl< url_aggregator >(std::string_view user_input, const url_aggregator *base_url)
ada::parser::parse_url< url_aggregator >
template url_aggregator parse_url< url_aggregator >(std::string_view user_input, const url_aggregator *base_url)
ada::parser::parse_url_impl
result_type parse_url_impl(std::string_view user_input, const result_type *base_url=nullptr)
Definition parser.cpp:14
ada
Definition ada_idna.h:13
ada::errors
errors
Error codes for URL parsing operations.
Definition errors.h:17
ada::url_aggregator
Memory-efficient URL representation using a single buffer.
Definition url_aggregator.h:46
ada::url
Represents a parsed URL with individual string components.
Definition url.h:62
url_pattern_init.h
Declaration for the url_pattern_init implementation.
url_pattern_regex.h