28template <
typename out_iter>
29void encode_json(std::string_view view, out_iter out);
45 std::string_view& input)
noexcept;
98bool overlaps(std::string_view input1,
const std::string& input2)
noexcept;
107 size_t pos2)
noexcept {
108#if ADA_DEVELOPMENT_CHECKS
110 std::cerr <<
"Negative-length substring: [" << pos1 <<
" to " << pos2 <<
")"
115 return std::string_view(input.data() + pos1, pos2 - pos1);
131 const bool is_special, std::string_view& view)
noexcept;
145template <
class url_type>
147 url_type& url)
noexcept;
154find_authority_delimiter_special(std::string_view view)
noexcept;
161find_authority_delimiter(std::string_view view)
noexcept;
166template <
typename T,
typename... Args>
167inline void inner_concat(std::string& buffer, T t) {
174template <
typename T,
typename... Args>
175inline void inner_concat(std::string& buffer, T t, Args... args) {
177 return inner_concat(buffer, args...);
185template <
typename... Args>
186std::string concat(Args... args) {
188 inner_concat(answer, args...);
196inline int leading_zeroes(uint32_t input_num)
noexcept {
197#if ADA_REGULAR_VISUAL_STUDIO
198 unsigned long leading_zero(0);
199 unsigned long in(input_num);
200 return _BitScanReverse(&leading_zero, in) ? int(31 - leading_zero) : 32;
202 return __builtin_clz(input_num);
212inline int fast_digit_count(uint32_t x)
noexcept {
213 auto int_log2 = [](uint32_t z) ->
int {
214 return 31 - ada::helpers::leading_zeroes(z | 1);
220 const static uint64_t
table[] = {
221 4294967296, 8589934582, 8589934582, 8589934582, 12884901788,
222 12884901788, 12884901788, 17179868184, 17179868184, 17179868184,
223 21474826480, 21474826480, 21474826480, 21474826480, 25769703776,
224 25769703776, 25769703776, 30063771072, 30063771072, 30063771072,
225 34349738368, 34349738368, 34349738368, 34349738368, 38554705664,
226 38554705664, 38554705664, 41949672960, 41949672960, 41949672960,
227 42949672960, 42949672960};
228 return int((x + table[int_log2(x)]) >> 32);
Common definitions for cross-platform compiler support.
#define ada_really_inline
Includes the definitions for helper functions.
const uint32_t table[8000][2]
Definitions for the states of the URL state machine.
Declaration for the basic URL definitions.