Loading...
Searching...
No Matches
implementation.h
Go to the documentation of this file.
#ifndef ADA_IMPLEMENTATION_H
#define ADA_IMPLEMENTATION_H
#include <string>
#include <string_view>
#include <optional>
#include "ada/url.h"
#include "ada/common_defs.h"
#include "ada/errors.h"
#include "ada/url_pattern_init.h"
namespace ada {
template <class result_type = ada::url_aggregator>
using result = tl::expected<result_type, ada::errors>;
template <class result_type = ada::url_aggregator>
ada_warn_unused ada::result<result_type> parse(
std::string_view input, const result_type* base_url = nullptr);
extern template ada::result<url> parse<url>(std::string_view input,
const url* base_url);
extern template ada::result<url_aggregator> parse<url_aggregator>(
std::string_view input, const url_aggregator* base_url);
bool can_parse(std::string_view input,
const std::string_view* base_input = nullptr);
#if ADA_INCLUDE_URL_PATTERN
template <url_pattern_regex::regex_concept regex_provider>
ada_warn_unused tl::expected<url_pattern<regex_provider>, errors>
parse_url_pattern(std::variant<std::string_view, url_pattern_init>&& input,
const std::string_view* base_url = nullptr,
const url_pattern_options* options = nullptr);
#endif // ADA_INCLUDE_URL_PATTERN
std::string href_from_file(std::string_view path);
} // namespace ada
#endif // ADA_IMPLEMENTATION_H
common_defs.h
Cross-platform compiler macros and common definitions.
ada_warn_unused
#define ada_warn_unused
Definition common_defs.h:89
errors.h
Error type definitions for URL parsing.
ada
Definition ada_idna.h:13
ada::can_parse
bool can_parse(std::string_view input, const std::string_view *base_input=nullptr)
Definition implementation.cpp:51
ada::parse< url >
template ada::result< url > parse< url >(std::string_view input, const url *base_url)
ada::href_from_file
std::string href_from_file(std::string_view path)
Definition implementation.cpp:28
ada::errors
errors
Error codes for URL parsing operations.
Definition errors.h:17
ada::parse< url_aggregator >
template ada::result< url_aggregator > parse< url_aggregator >(std::string_view input, const url_aggregator *base_url)
ada::result
tl::expected< result_type, ada::errors > result
Definition implementation.h:44
ada::parse
ada_warn_unused ada::result< result_type > parse(std::string_view input, const result_type *base_url=nullptr)
Definition implementation.cpp:13
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.h
Declaration for the ada::url class.
url_pattern_init.h
Declaration for the url_pattern_init implementation.