Ada 4.1.1
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
ada::parser::anonymous_namespace{parser.cpp} Namespace Reference

Classes

struct  nibble_tables

Functions

consteval nibble_tables make_stop_nibble_tables (const std::array< uint8_t, 256 > &cls)
ada_really_inline uint32_t port_decimal_digit_count (uint32_t port) noexcept
ada_really_inline void append_canonical_port (std::string &buffer, uint32_t port)
ada_really_inline int trailing_zeroes32 (uint32_t input_num) noexcept
ada_really_inline int trailing_zeroes64 (uint64_t input_num) noexcept
ada_really_inline bool authority_has_at (const uint8_t *p, size_t host_start, size_t n) noexcept
ADA_PARSER_SIMD bool scan_plain_host (const uint8_t *b, size_t start, size_t len, size_t &end, bool &has_upper, bool &has_x) noexcept
ada_really_inline void note_possible_dot_segment (const uint8_t *b, size_t pos, size_t run_start, bool &maybe_dot_segment) noexcept
ADA_PARSER_SIMD void scan_path_run (const uint8_t *b, size_t &i, size_t len, bool &maybe_dot_segment) noexcept
ADA_PARSER_SIMD void scan_query_run (const uint8_t *b, size_t &i, size_t len) noexcept
ADA_PARSER_SIMD void scan_hash_run (const uint8_t *b, size_t &i, size_t len) noexcept
bool path_has_dot_segment (std::string_view path) noexcept

Variables

constexpr std::array< uint8_t, 256 > k_host_class
constexpr std::array< uint8_t, 256 > k_path
constexpr std::array< uint8_t, 256 > k_query
constexpr std::array< uint8_t, 256 > k_hash
constexpr nibble_tables k_host_nibbles = make_stop_nibble_tables(k_host_class)
constexpr nibble_tables k_path_nibbles = make_stop_nibble_tables(k_path)
constexpr nibble_tables k_query_nibbles = make_stop_nibble_tables(k_query)
constexpr nibble_tables k_hash_nibbles = make_stop_nibble_tables(k_hash)

Function Documentation

◆ append_canonical_port()

ada_really_inline void ada::parser::anonymous_namespace{parser.cpp}::append_canonical_port ( std::string & buffer,
uint32_t port )

Definition at line 209 of file parser.cpp.

References ada_really_inline, and append_canonical_port().

Referenced by append_canonical_port().

◆ authority_has_at()

ada_really_inline bool ada::parser::anonymous_namespace{parser.cpp}::authority_has_at ( const uint8_t * p,
size_t host_start,
size_t n )
noexcept

Definition at line 357 of file parser.cpp.

References ada_really_inline, and authority_has_at().

Referenced by authority_has_at().

◆ make_stop_nibble_tables()

nibble_tables ada::parser::anonymous_namespace{parser.cpp}::make_stop_nibble_tables ( const std::array< uint8_t, 256 > & cls)
consteval

◆ note_possible_dot_segment()

ada_really_inline void ada::parser::anonymous_namespace{parser.cpp}::note_possible_dot_segment ( const uint8_t * b,
size_t pos,
size_t run_start,
bool & maybe_dot_segment )
noexcept

Definition at line 600 of file parser.cpp.

References ada_really_inline, and note_possible_dot_segment().

Referenced by note_possible_dot_segment(), and scan_path_run().

◆ path_has_dot_segment()

bool ada::parser::anonymous_namespace{parser.cpp}::path_has_dot_segment ( std::string_view path)
noexcept

Definition at line 979 of file parser.cpp.

References path_has_dot_segment().

Referenced by path_has_dot_segment().

◆ port_decimal_digit_count()

ada_really_inline uint32_t ada::parser::anonymous_namespace{parser.cpp}::port_decimal_digit_count ( uint32_t port)
noexcept

Definition at line 200 of file parser.cpp.

References ada_really_inline, and port_decimal_digit_count().

Referenced by port_decimal_digit_count().

◆ scan_hash_run()

ADA_PARSER_SIMD void ada::parser::anonymous_namespace{parser.cpp}::scan_hash_run ( const uint8_t * b,
size_t & i,
size_t len )
noexcept

Definition at line 972 of file parser.cpp.

References ADA_PARSER_SIMD, ADA_SCAN_STOP_RUN, k_hash, k_hash_nibbles, and scan_hash_run().

Referenced by scan_hash_run().

◆ scan_path_run()

ADA_PARSER_SIMD void ada::parser::anonymous_namespace{parser.cpp}::scan_path_run ( const uint8_t * b,
size_t & i,
size_t len,
bool & maybe_dot_segment )
noexcept

◆ scan_plain_host()

ADA_PARSER_SIMD bool ada::parser::anonymous_namespace{parser.cpp}::scan_plain_host ( const uint8_t * b,
size_t start,
size_t len,
size_t & end,
bool & has_upper,
bool & has_x )
noexcept

◆ scan_query_run()

ADA_PARSER_SIMD void ada::parser::anonymous_namespace{parser.cpp}::scan_query_run ( const uint8_t * b,
size_t & i,
size_t len )
noexcept

Definition at line 967 of file parser.cpp.

References ADA_PARSER_SIMD, ADA_SCAN_STOP_RUN, k_query, k_query_nibbles, and scan_query_run().

Referenced by scan_query_run().

◆ trailing_zeroes32()

ada_really_inline int ada::parser::anonymous_namespace{parser.cpp}::trailing_zeroes32 ( uint32_t input_num)
noexcept

Definition at line 218 of file parser.cpp.

References ada_really_inline, and trailing_zeroes32().

Referenced by scan_path_run(), scan_plain_host(), and trailing_zeroes32().

◆ trailing_zeroes64()

ada_really_inline int ada::parser::anonymous_namespace{parser.cpp}::trailing_zeroes64 ( uint64_t input_num)
noexcept

Definition at line 228 of file parser.cpp.

References ada_really_inline, and trailing_zeroes64().

Referenced by scan_path_run(), scan_plain_host(), and trailing_zeroes64().

Variable Documentation

◆ k_hash

std::array<uint8_t, 256> ada::parser::anonymous_namespace{parser.cpp}::k_hash
constexpr
Initial value:
= []() consteval {
std::array<uint8_t, 256> t{};
for (size_t i = 0; i < 256; ++i) {
t[i] = 2;
}
for (uint8_t c = 0x21; c <= 0x7E; ++c) {
t[c] = 0;
}
for (uint8_t c : {static_cast<uint8_t>('"'), static_cast<uint8_t>('<'),
static_cast<uint8_t>('>'), static_cast<uint8_t>('`')}) {
t[c] = 2;
}
return t;
}()

Definition at line 129 of file parser.cpp.

Referenced by scan_hash_run().

◆ k_hash_nibbles

nibble_tables ada::parser::anonymous_namespace{parser.cpp}::k_hash_nibbles = make_stop_nibble_tables(k_hash)
constexpr

Definition at line 193 of file parser.cpp.

Referenced by scan_hash_run().

◆ k_host_class

std::array<uint8_t, 256> ada::parser::anonymous_namespace{parser.cpp}::k_host_class
constexpr
Initial value:
= []() consteval {
std::array<uint8_t, 256> t{};
for (size_t i = 0; i < 256; ++i) {
t[i] = 2;
}
for (size_t i = 0x21; i <= 0x7E; ++i) {
t[i] = 0;
}
for (uint8_t c :
{'#', '/', ':', '<', '>', '?', '@', '[', '\\', ']', '^', '|', '%'}) {
t[c] = 2;
}
t[static_cast<uint8_t>('/')] = 1;
t[static_cast<uint8_t>('?')] = 1;
t[static_cast<uint8_t>('#')] = 1;
t[static_cast<uint8_t>(':')] = 1;
return t;
}()

Definition at line 71 of file parser.cpp.

Referenced by scan_plain_host().

◆ k_host_nibbles

nibble_tables ada::parser::anonymous_namespace{parser.cpp}::k_host_nibbles = make_stop_nibble_tables(k_host_class)
constexpr

Definition at line 190 of file parser.cpp.

Referenced by scan_plain_host().

◆ k_path

std::array<uint8_t, 256> ada::parser::anonymous_namespace{parser.cpp}::k_path
constexpr
Initial value:
= []() consteval {
std::array<uint8_t, 256> t{};
for (size_t i = 0; i < 256; ++i) {
t[i] = 2;
}
for (uint8_t c = 0x21; c <= 0x7E; ++c) {
t[c] = 0;
}
for (uint8_t c : {static_cast<uint8_t>('"'), static_cast<uint8_t>('<'),
static_cast<uint8_t>('>'), static_cast<uint8_t>('`'),
static_cast<uint8_t>('{'), static_cast<uint8_t>('}'),
static_cast<uint8_t>('^'), static_cast<uint8_t>('\\'),
static_cast<uint8_t>('%')}) {
t[c] = 2;
}
t[static_cast<uint8_t>('?')] = 1;
t[static_cast<uint8_t>('#')] = 1;
return t;
}()

Definition at line 91 of file parser.cpp.

Referenced by scan_path_run().

◆ k_path_nibbles

nibble_tables ada::parser::anonymous_namespace{parser.cpp}::k_path_nibbles = make_stop_nibble_tables(k_path)
constexpr

Definition at line 191 of file parser.cpp.

Referenced by scan_path_run().

◆ k_query

std::array<uint8_t, 256> ada::parser::anonymous_namespace{parser.cpp}::k_query
constexpr
Initial value:
= []() consteval {
std::array<uint8_t, 256> t{};
for (size_t i = 0; i < 256; ++i) {
t[i] = 2;
}
for (uint8_t c = 0x21; c <= 0x7E; ++c) {
t[c] = 0;
}
for (uint8_t c : {static_cast<uint8_t>('"'), static_cast<uint8_t>('<'),
static_cast<uint8_t>('>'), static_cast<uint8_t>('\'')}) {
t[c] = 2;
}
t[static_cast<uint8_t>('#')] = 1;
return t;
}()

Definition at line 112 of file parser.cpp.

Referenced by scan_query_run().

◆ k_query_nibbles

nibble_tables ada::parser::anonymous_namespace{parser.cpp}::k_query_nibbles = make_stop_nibble_tables(k_query)
constexpr

Definition at line 192 of file parser.cpp.

Referenced by scan_query_run().