Ada 2.8.0
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
ada::helpers Namespace Reference

Includes the definitions for helper functions. More...

Functions

ada_unused std::string get_state (ada::state s)
 
ada_really_inline int trailing_zeroes (uint32_t input_num) noexcept
 
ada_really_inline size_t find_next_host_delimiter_special (std::string_view view, size_t location) noexcept
 
ada_really_inline size_t find_next_host_delimiter (std::string_view view, size_t location) noexcept
 

Variables

static constexpr std::array< uint8_t, 256 > special_host_delimiters
 
static constexpr std::array< uint8_t, 256 > host_delimiters
 
static constexpr std::array< uint8_t, 256 > authority_delimiter_special
 
static constexpr std::array< uint8_t, 256 > authority_delimiter
 

Detailed Description

Includes the definitions for helper functions.

These functions are not part of our public API and may change at any time.

Function Documentation

◆ find_next_host_delimiter()

ada_really_inline size_t ada::helpers::find_next_host_delimiter ( std::string_view view,
size_t location )
noexcept

Definition at line 460 of file helpers.cpp.

References host_delimiters.

◆ find_next_host_delimiter_special()

ada_really_inline size_t ada::helpers::find_next_host_delimiter_special ( std::string_view view,
size_t location )
noexcept

Definition at line 328 of file helpers.cpp.

References special_host_delimiters.

◆ get_state()

◆ trailing_zeroes()

ada_really_inline int ada::helpers::trailing_zeroes ( uint32_t input_num)
noexcept

Definition at line 177 of file helpers.cpp.

Variable Documentation

◆ authority_delimiter

std::array<uint8_t, 256> ada::helpers::authority_delimiter
staticconstexpr
Initial value:
= []() constexpr {
std::array<uint8_t, 256> result{};
for (uint8_t i : {'@', '/', '?'}) {
result[i] = 1;
}
return result;
}()
tl::expected< result_type, ada::errors > result

Definition at line 768 of file helpers.cpp.

◆ authority_delimiter_special

std::array<uint8_t, 256> ada::helpers::authority_delimiter_special
staticconstexpr
Initial value:
=
[]() constexpr {
std::array<uint8_t, 256> result{};
for (uint8_t i : {'@', '/', '\\', '?'}) {
result[i] = 1;
}
return result;
}()

Definition at line 746 of file helpers.cpp.

◆ host_delimiters

std::array<uint8_t, 256> ada::helpers::host_delimiters
staticconstexpr
Initial value:
= []() constexpr {
std::array<uint8_t, 256> result{};
for (int i : {':', '/', '?', '['}) {
result[i] = 1;
}
return result;
}()

Definition at line 452 of file helpers.cpp.

Referenced by find_next_host_delimiter().

◆ special_host_delimiters

std::array<uint8_t, 256> ada::helpers::special_host_delimiters
staticconstexpr
Initial value:
=
[]() constexpr {
std::array<uint8_t, 256> result{};
for (int i : {':', '/', '[', '\\', '?'}) {
result[i] = 1;
}
return result;
}()

Definition at line 319 of file helpers.cpp.

Referenced by find_next_host_delimiter_special().