18#if ADA_DEVELOPMENT_CHECKS
36template <
typename out_iter>
37void encode_json(std::string_view view, out_iter out);
53 std::string_view& input)
noexcept;
104bool overlaps(std::string_view input1,
const std::string& input2)
noexcept;
114#if ADA_DEVELOPMENT_CHECKS
116 std::cerr <<
"Negative-length substring: [" << pos1 <<
" to " << pos2 <<
")"
121 return input.substr(pos1, pos2 - pos1);
137 bool is_special, std::string_view& view)
noexcept;
144void trim_c0_whitespace(std::string_view& input)
noexcept;
151template <
class url_type>
159find_authority_delimiter_special(std::string_view view)
noexcept;
166find_authority_delimiter(std::string_view view)
noexcept;
171template <
typename T,
typename... Args>
172inline void inner_concat(std::string& buffer, T t) {
179template <
typename T,
typename... Args>
180inline void inner_concat(std::string& buffer, T t, Args... args) {
182 return inner_concat(buffer, args...);
190template <
typename... Args>
191std::string concat(Args... args) {
193 inner_concat(answer, args...);
201inline int leading_zeroes(uint32_t input_num)
noexcept {
202#if ADA_REGULAR_VISUAL_STUDIO
203 unsigned long leading_zero(0);
204 unsigned long in(input_num);
205 return _BitScanReverse(&leading_zero, in) ? int(31 - leading_zero) : 32;
207 return __builtin_clz(input_num);
217inline int fast_digit_count(uint32_t x)
noexcept {
218 auto int_log2 = [](uint32_t z) ->
int {
219 return 31 - ada::helpers::leading_zeroes(z | 1);
225 const static uint64_t table[] = {
226 4294967296, 8589934582, 8589934582, 8589934582, 12884901788,
227 12884901788, 12884901788, 17179868184, 17179868184, 17179868184,
228 21474826480, 21474826480, 21474826480, 21474826480, 25769703776,
229 25769703776, 25769703776, 30063771072, 30063771072, 30063771072,
230 34349738368, 34349738368, 34349738368, 34349738368, 38554705664,
231 38554705664, 38554705664, 41949672960, 41949672960, 41949672960,
232 42949672960, 42949672960};
233 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.