Ada
3.4.3
Fast spec-compliant URL parser
Toggle main menu visibility
Loading...
Searching...
No Matches
implementation.h
Go to the documentation of this file.
1
11
#ifndef ADA_IMPLEMENTATION_H
12
#define ADA_IMPLEMENTATION_H
13
14
#include <string>
15
#include <string_view>
16
#include <optional>
17
18
#include "
ada/url.h
"
19
#include "
ada/common_defs.h
"
20
#include "
ada/errors.h
"
21
#include "
ada/url_pattern_init.h
"
22
23
namespace
ada
{
24
43
template
<
class
result_type = ada::url_aggregator>
44
using
result
= tl::expected<result_type, ada::errors>;
45
90
template
<
class
result_type = ada::url_aggregator>
91
ada_warn_unused
ada::result<result_type>
parse
(
92
std::string_view input,
const
result_type* base_url =
nullptr
);
93
94
extern
template
ada::result<url>
parse<url>
(std::string_view input,
95
const
url
* base_url);
96
extern
template
ada::result<url_aggregator>
parse<url_aggregator>
(
97
std::string_view input,
const
url_aggregator
* base_url);
98
127
bool
can_parse
(std::string_view input,
128
const
std::string_view* base_input =
nullptr
);
129
130
#if ADA_INCLUDE_URL_PATTERN
151
template
<url_pattern_regex::regex_concept regex_prov
id
er>
152
ada_warn_unused
tl::expected<url_pattern<regex_provider>,
errors
>
153
parse_url_pattern(std::variant<std::string_view, url_pattern_init>&& input,
154
const
std::string_view* base_url =
nullptr
,
155
const
url_pattern_options* options =
nullptr
);
156
#endif
// ADA_INCLUDE_URL_PATTERN
157
168
std::string
href_from_file
(std::string_view path);
169
}
// namespace ada
170
171
#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.