Ada 2.9.2
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
ada_idna.cpp File Reference
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <array>
#include <string>
#include <string_view>

Go to the source code of this file.

Classes

struct  ada::idna::directions
 

Namespaces

namespace  ada
 
namespace  ada::idna
 

Macros

#define ADA_IDNA_TABLES_H
 
#define ADA_IDNA_NORMALIZATION_TABLES_H
 

Enumerations

enum  ada::idna::direction : uint8_t {
  ada::idna::NONE , ada::idna::BN , ada::idna::CS , ada::idna::ES ,
  ada::idna::ON , ada::idna::EN , ada::idna::L , ada::idna::R ,
  ada::idna::NSM , ada::idna::AL , ada::idna::AN , ada::idna::ET ,
  ada::idna::WS , ada::idna::RLO , ada::idna::LRO , ada::idna::PDF ,
  ada::idna::RLE , ada::idna::RLI , ada::idna::FSI , ada::idna::PDI ,
  ada::idna::LRI , ada::idna::B , ada::idna::S , ada::idna::LRE
}
 

Functions

size_t ada::idna::utf8_to_utf32 (const char *buf, size_t len, char32_t *utf32_output)
 
size_t ada::idna::utf8_length_from_utf32 (const char32_t *buf, size_t len)
 
size_t ada::idna::utf32_length_from_utf8 (const char *buf, size_t len)
 
size_t ada::idna::utf32_to_utf8 (const char32_t *buf, size_t len, char *utf8_output)
 
uint32_t ada::idna::find_range_index (uint32_t key)
 
bool ada::idna::ascii_has_upper_case (char *input, size_t length)
 
void ada::idna::ascii_map (char *input, size_t length)
 
std::u32string ada::idna::map (std::u32string_view input)
 
std::pair< bool, size_t > ada::idna::compute_decomposition_length (const std::u32string_view input) noexcept
 
void ada::idna::decompose (std::u32string &input, size_t additional_elements)
 
uint8_t ada::idna::get_ccc (char32_t c) noexcept
 
void ada::idna::sort_marks (std::u32string &input)
 
void ada::idna::decompose_nfc (std::u32string &input)
 
void ada::idna::compose (std::u32string &input)
 
void ada::idna::normalize (std::u32string &input)
 
static constexpr int32_t ada::idna::char_to_digit_value (char value)
 
static constexpr char ada::idna::digit_to_char (int32_t digit)
 
static constexpr int32_t ada::idna::adapt (int32_t d, int32_t n, bool firsttime)
 
bool ada::idna::punycode_to_utf32 (std::string_view input, std::u32string &out)
 
bool ada::idna::verify_punycode (std::string_view input)
 
bool ada::idna::utf32_to_punycode (std::u32string_view input, std::string &out)
 
static direction ada::idna::find_direction (uint32_t code_point) noexcept
 
static size_t ada::idna::find_last_not_of_nsm (const std::u32string_view label) noexcept
 
static bool ada::idna::is_rtl_label (const std::u32string_view label) noexcept
 
bool ada::idna::is_label_valid (std::u32string_view label)
 
bool constexpr ada::idna::is_ascii (std::u32string_view view)
 
bool constexpr ada::idna::is_ascii (std::string_view view)
 
bool ada::idna::is_forbidden_domain_code_point (const char c) noexcept
 
bool ada::idna::contains_forbidden_domain_code_point (std::string_view ascii_string)
 
static std::string ada::idna::from_ascii_to_ascii (std::string_view ut8_string)
 
std::string ada::idna::to_ascii (std::string_view ut8_string)
 
std::string ada::idna::to_unicode (std::string_view input)
 

Variables

const uint32_t ada::idna::mappings [5164]
 
const uint32_t ada::idna::table [8000][2]
 
const uint8_t ada::idna::decomposition_index [4352]
 
const uint16_t ada::idna::decomposition_block [67][257]
 
const char32_t ada::idna::decomposition_data [9102]
 
const uint8_t ada::idna::canonical_combining_class_index [4352]
 
const uint8_t ada::idna::canonical_combining_class_block [67][256]
 
const uint8_t ada::idna::composition_index [4352]
 
const uint16_t ada::idna::composition_block [67][257]
 
const char32_t ada::idna::composition_data [1883]
 
constexpr char32_t ada::idna::hangul_sbase = 0xAC00
 
constexpr char32_t ada::idna::hangul_tbase = 0x11A7
 
constexpr char32_t ada::idna::hangul_vbase = 0x1161
 
constexpr char32_t ada::idna::hangul_lbase = 0x1100
 
constexpr char32_t ada::idna::hangul_lcount = 19
 
constexpr char32_t ada::idna::hangul_vcount = 21
 
constexpr char32_t ada::idna::hangul_tcount = 28
 
constexpr char32_t ada::idna::hangul_ncount = hangul_vcount * hangul_tcount
 
constexpr char32_t ada::idna::hangul_scount
 
constexpr int32_t ada::idna::base = 36
 
constexpr int32_t ada::idna::tmin = 1
 
constexpr int32_t ada::idna::tmax = 26
 
constexpr int32_t ada::idna::skew = 38
 
constexpr int32_t ada::idna::damp = 700
 
constexpr int32_t ada::idna::initial_bias = 72
 
constexpr uint32_t ada::idna::initial_n = 128
 
static directions ada::idna::dir_table []
 
static constexpr uint8_t ada::idna::is_forbidden_domain_code_point_table []
 

Macro Definition Documentation

◆ ADA_IDNA_NORMALIZATION_TABLES_H

#define ADA_IDNA_NORMALIZATION_TABLES_H

Definition at line 2721 of file ada_idna.cpp.

◆ ADA_IDNA_TABLES_H

#define ADA_IDNA_TABLES_H

Definition at line 197 of file ada_idna.cpp.