15#if ADA_DEVELOPMENT_CHECKS
32template <
typename out_iter>
33void encode_json(std::string_view view, out_iter out);
49 std::string_view& input)
noexcept;
100bool overlaps(std::string_view input1,
const std::string& input2)
noexcept;
110#if ADA_DEVELOPMENT_CHECKS
112 std::cerr <<
"Negative-length substring: [" << pos1 <<
" to " << pos2 <<
")"
117 return input.substr(pos1, pos2 - pos1);
133 bool is_special, std::string_view& view)
noexcept;
140void trim_c0_whitespace(std::string_view& input)
noexcept;
147template <
class url_type>
155find_authority_delimiter_special(std::string_view view)
noexcept;
162find_authority_delimiter(std::string_view view)
noexcept;
167template <
typename T,
typename... Args>
168inline void inner_concat(std::string& buffer, T t) {
175template <
typename T,
typename... Args>
176inline void inner_concat(std::string& buffer, T t, Args... args) {
178 return inner_concat(buffer, args...);
186template <
typename... Args>
187std::string concat(Args... args) {
189 inner_concat(answer, args...);
197inline int leading_zeroes(uint32_t input_num)
noexcept {
198#if ADA_REGULAR_VISUAL_STUDIO
199 unsigned long leading_zero(0);
200 unsigned long in(input_num);
201 return _BitScanReverse(&leading_zero, in) ? int(31 - leading_zero) : 32;
203 return __builtin_clz(input_num);
213inline int fast_digit_count(uint32_t x)
noexcept {
214 auto int_log2 = [](uint32_t z) ->
int {
215 return 31 - ada::helpers::leading_zeroes(z | 1);
221 const static uint64_t table[] = {
222 4294967296, 8589934582, 8589934582, 8589934582, 12884901788,
223 12884901788, 12884901788, 17179868184, 17179868184, 17179868184,
224 21474826480, 21474826480, 21474826480, 21474826480, 25769703776,
225 25769703776, 25769703776, 30063771072, 30063771072, 30063771072,
226 34349738368, 34349738368, 34349738368, 34349738368, 38554705664,
227 38554705664, 38554705664, 41949672960, 41949672960, 41949672960,
228 42949672960, 42949672960};
229 return int((x + table[int_log2(x)]) >> 32);
Cross-platform compiler macros and common definitions.
#define ada_really_inline
Includes the definitions for helper functions.
type
Enumeration of URL scheme types.
Represents a parsed URL with individual string components.
Base class and common definitions for URL types.