Ada 2.8.0
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
implementation.h
Go to the documentation of this file.
1
6#ifndef ADA_IMPLEMENTATION_H
7#define ADA_IMPLEMENTATION_H
8
9#include <string>
10#include <optional>
11
12#include "ada/parser.h"
13#include "ada/common_defs.h"
14#include "ada/encoding_type.h"
15#include "ada/url.h"
16#include "ada/state.h"
17#include "ada/url_aggregator.h"
18
19namespace ada {
20enum class errors { generic_error };
21
22template <class result_type = ada::url_aggregator>
23using result = tl::expected<result_type, ada::errors>;
24
34template <class result_type = ada::url_aggregator>
36 std::string_view input, const result_type* base_url = nullptr);
37
38extern template ada::result<url> parse<url>(std::string_view input,
39 const url* base_url);
41 std::string_view input, const url_aggregator* base_url);
42
49bool can_parse(std::string_view input,
50 const std::string_view* base_input = nullptr);
51
57std::string href_from_file(std::string_view path);
58} // namespace ada
59
60#endif // ADA_IMPLEMENTATION_H
Common definitions for cross-platform compiler support.
#define ada_warn_unused
Definition common_defs.h:88
Definition for supported encoding types.
Definition ada_idna.h:13
bool can_parse(std::string_view input, const std::string_view *base_input=nullptr)
template ada::result< url > parse< url >(std::string_view input, const url *base_url)
std::string href_from_file(std::string_view path)
template ada::result< url_aggregator > parse< url_aggregator >(std::string_view input, const url_aggregator *base_url)
tl::expected< result_type, ada::errors > result
ada_warn_unused ada::result< result_type > parse(std::string_view input, const result_type *base_url=nullptr)
Definitions for the parser.
Definitions for the states of the URL state machine.
Lightweight URL struct.
Generic URL struct reliant on std::string instantiation.
Definition url.h:38
Declaration for the URL.
Declaration for the basic URL definitions.