Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qurlidna.cpp File Reference

(b2764f780261f365005a80f5381925152df11bfb)

#include "qurl_p.h"
#include <QtCore/qstringlist.h>
#include <QtCore/private/qnumeric_p.h>
#include <QtCore/private/qoffsetstringarray_p.h>
#include <QtCore/private/qstringiterator_p.h>
#include <QtCore/private/qunicodetables_p.h>
#include <algorithm>
+ Include dependency graph for qurlidna.cpp:

Go to the source code of this file.

Functions

static uint encodeDigit (uint digit)
 
static uint adapt (uint delta, uint numpoints, bool firsttime)
 
static void appendEncode (QString *output, uint delta, uint bias)
 
Q_AUTOTEST_EXPORT void qt_punycodeEncoder (QStringView in, QString *output)
 
Q_AUTOTEST_EXPORT QString qt_punycodeDecoder (const QString &pc)
 
static bool lessThan (const QChar *a, int l, const char *c)
 
static bool equal (const QChar *a, int l, const char *b)
 
static bool qt_is_idn_enabled (QStringView aceDomain)
 
template<typename C >
static bool isValidInNormalizedAsciiLabel (C c)
 
template<typename C >
static bool isValidInNormalizedAsciiName (C c)
 
static QString mapDomainName (const QString &in, QUrl::AceProcessingOptions options, bool *resultIsAscii)
 
static bool validateAsciiLabel (QStringView label)
 
static QString convertToAscii (QStringView normalizedDomain, AceLeadingDot dot)
 
static bool checkAsciiDomainName (QStringView normalizedDomain, AceLeadingDot dot, bool *usesPunycode)
 
static QString convertToUnicode (const QString &asciiDomain, QUrl::AceProcessingOptions options)
 
static bool checkUnicodeName (const QString &domainName, QUrl::AceProcessingOptions options)
 
QString qt_ACE_do (const QString &domain, AceOperation op, AceLeadingDot dot, QUrl::AceProcessingOptions options)
 

Variables

static const uint base = 36
 
static const uint tmin = 1
 
static const uint tmax = 26
 
static const uint skew = 38
 
static const uint damp = 700
 
static const uint initial_bias = 72
 
static const uint initial_n = 128
 
static constexpr qsizetype MaxDomainLabelLength = 63
 
static constexpr auto idn_whitelist
 
static Q_CONSTINIT QStringListuser_idn_whitelist = nullptr
 

Function Documentation

◆ adapt()

static uint adapt ( uint delta,
uint numpoints,
bool firsttime )
inlinestatic

Definition at line 35 of file qurlidna.cpp.

References base, damp, skew, tmax, and tmin.

Referenced by qt_punycodeEncoder().

+ Here is the caller graph for this function:

◆ appendEncode()

static void appendEncode ( QString * output,
uint delta,
uint bias )
inlinestatic

Definition at line 47 of file qurlidna.cpp.

Referenced by qt_punycodeEncoder().

+ Here is the caller graph for this function:

◆ checkAsciiDomainName()

static bool checkAsciiDomainName ( QStringView normalizedDomain,
AceLeadingDot dot,
bool * usesPunycode )
static

Definition at line 821 of file qurlidna.cpp.

References ForbidLeadingDot.

◆ checkUnicodeName()

static bool checkUnicodeName ( const QString & domainName,
QUrl::AceProcessingOptions options )
static

Definition at line 893 of file qurlidna.cpp.

◆ convertToAscii()

static QString convertToAscii ( QStringView normalizedDomain,
AceLeadingDot dot )
static

Definition at line 786 of file qurlidna.cpp.

◆ convertToUnicode()

static QString convertToUnicode ( const QString & asciiDomain,
QUrl::AceProcessingOptions options )
static

Definition at line 854 of file qurlidna.cpp.

◆ encodeDigit()

static uint encodeDigit ( uint digit)
inlinestatic

Definition at line 30 of file qurlidna.cpp.

◆ equal()

static bool equal ( const QChar * a,
int l,
const char * b )
static

Definition at line 338 of file qurlidna.cpp.

◆ isValidInNormalizedAsciiLabel()

template<typename C >
static bool isValidInNormalizedAsciiLabel ( C c)
inlinestatic

Definition at line 379 of file qurlidna.cpp.

◆ isValidInNormalizedAsciiName()

template<typename C >
static bool isValidInNormalizedAsciiName ( C c)
inlinestatic

Definition at line 385 of file qurlidna.cpp.

◆ lessThan()

static bool lessThan ( const QChar * a,
int l,
const char * c )
static

Definition at line 321 of file qurlidna.cpp.

◆ mapDomainName()

static QString mapDomainName ( const QString & in,
QUrl::AceProcessingOptions options,
bool * resultIsAscii )
static

Definition at line 397 of file qurlidna.cpp.

◆ qt_ACE_do()

QString qt_ACE_do ( const QString & domain,
AceOperation op,
AceLeadingDot dot,
QUrl::AceProcessingOptions options )

Definition at line 920 of file qurlidna.cpp.

◆ qt_is_idn_enabled()

static bool qt_is_idn_enabled ( QStringView aceDomain)
static

Definition at line 350 of file qurlidna.cpp.

◆ qt_punycodeDecoder()

Q_AUTOTEST_EXPORT QString qt_punycodeDecoder ( const QString & pc)

Definition at line 171 of file qurlidna.cpp.

◆ qt_punycodeEncoder()

Q_AUTOTEST_EXPORT void qt_punycodeEncoder ( QStringView in,
QString * output )

Definition at line 67 of file qurlidna.cpp.

References adapt(), appendEncode(), initial_bias, and initial_n.

+ Here is the call graph for this function:

◆ validateAsciiLabel()

static bool validateAsciiLabel ( QStringView label)
static

Definition at line 474 of file qurlidna.cpp.

Variable Documentation

◆ base

static const uint base = 36
static

Definition at line 20 of file qurlidna.cpp.

Referenced by adapt().

◆ damp

static const uint damp = 700
static

Definition at line 24 of file qurlidna.cpp.

Referenced by adapt().

◆ idn_whitelist

static constexpr auto idn_whitelist
staticconstexpr

Definition at line 280 of file qurlidna.cpp.

◆ initial_bias

static const uint initial_bias = 72
static

Definition at line 25 of file qurlidna.cpp.

Referenced by qt_punycodeEncoder().

◆ initial_n

static const uint initial_n = 128
static

Definition at line 26 of file qurlidna.cpp.

Referenced by qt_punycodeEncoder().

◆ MaxDomainLabelLength

static constexpr qsizetype MaxDomainLabelLength = 63
staticconstexpr

Definition at line 28 of file qurlidna.cpp.

◆ skew

static const uint skew = 38
static

Definition at line 23 of file qurlidna.cpp.

Referenced by adapt().

◆ tmax

static const uint tmax = 26
static

Definition at line 22 of file qurlidna.cpp.

Referenced by adapt().

◆ tmin

static const uint tmin = 1
static

Definition at line 21 of file qurlidna.cpp.

Referenced by adapt().

◆ user_idn_whitelist

static Q_CONSTINIT QStringList * user_idn_whitelist = nullptr
static

Definition at line 319 of file qurlidna.cpp.