Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qurl_p.h File Reference

(01dfcfcecf454a7bdc92980403796f1d3a49d8a4)

#include <QtCore/private/qglobal_p.h>
#include "qurl.h"
+ Include dependency graph for qurl_p.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  AceLeadingDot { AllowLeadingDot , ForbidLeadingDot }
 
enum  AceOperation { ToAceOnly , NormalizeAce }
 

Functions

QT_BEGIN_NAMESPACE Q_AUTOTEST_EXPORT qsizetype qt_urlRecode (QString &appendTo, QStringView url, QUrl::ComponentFormattingOptions encoding, const ushort *tableModifications=nullptr)
 
QString Q_CORE_EXPORT qt_ACE_do (const QString &domain, AceOperation op, AceLeadingDot dot, QUrl::AceProcessingOptions options={})
 
Q_AUTOTEST_EXPORT void qt_punycodeEncoder (QStringView in, QString *output)
 
Q_AUTOTEST_EXPORT QString qt_punycodeDecoder (const QString &pc)
 

Enumeration Type Documentation

◆ AceLeadingDot

Enumerator
AllowLeadingDot 
ForbidLeadingDot 

Definition at line 30 of file qurl_p.h.

◆ AceOperation

Enumerator
ToAceOnly 
NormalizeAce 

Definition at line 31 of file qurl_p.h.

Function Documentation

◆ qt_ACE_do()

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

Definition at line 920 of file qurlidna.cpp.

References checkAsciiDomainName(), checkUnicodeName(), convertToAscii(), convertToUnicode(), dot(), QUrl::IgnoreIDNWhitelist, QString::isEmpty(), mapDomainName(), QString::NormalizationForm_C, qt_is_idn_enabled(), and ToAceOnly.

Referenced by QUrlPrivate::appendHost(), encodeLabel(), QUrl::fromAce(), qDBusInterfaceFromMetaObject(), QUrlPrivate::setHost(), and QUrl::toAce().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_punycodeDecoder()

Q_AUTOTEST_EXPORT QString qt_punycodeDecoder ( const QString & pc)
extern

Definition at line 171 of file qurlidna.cpp.

References adapt(), QString::at(), base, QString::fromStdU32String(), i, initial_bias, initial_n, QString::lastIndexOf(), MaxDomainLabelLength, QString::mid(), output, qWarning, QString::size(), QString::startsWith(), tmax, tmin, and QString::toStdU32String().

Referenced by convertToUnicode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_punycodeEncoder()

Q_AUTOTEST_EXPORT void qt_punycodeEncoder ( QStringView in,
QString * output )
extern

Definition at line 67 of file qurlidna.cpp.

References adapt(), appendEncode(), d, initial_bias, initial_n, iter, MaxDomainLabelLength, and output.

Referenced by convertToAscii().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_urlRecode()

QT_BEGIN_NAMESPACE Q_AUTOTEST_EXPORT qsizetype qt_urlRecode ( QString & appendTo,
QStringView in,
QUrl::ComponentFormattingOptions encoding,
const ushort * tableModifications )
extern

Recodes the string from begin to end. If any transformations are done, append them to appendTo and return the number of characters added. If no transformations were required, return 0.

The encoding option modifies the default behaviour: \list

  • QUrl::DecodeReserved: if set, reserved characters will be decoded; if unset, reserved characters will be encoded
  • QUrl::EncodeSpaces: if set, spaces will be encoded to "%20"; if unset, they will be " "
  • QUrl::EncodeUnicode: if set, characters above U+0080 will be encoded to their UTF-8 percent-encoded form; if unset, they will be decoded to UTF-16
  • QUrl::FullyDecoded: if set, this function will decode all percent-encoded sequences, including that of the percent character. The resulting string will not be percent-encoded anymore. Use with caution! In this mode, the behaviour is undefined if the input string contains any percent-encoding sequences above %80. Also, the function will not correct bad % sequences. \endlist

Other flags are ignored (including QUrl::EncodeReserved).

The tableModifications argument can be used to supply extra modifications to the tables, to be applied after the flags above are handled. It consists of a sequence of 16-bit values, where the low 8 bits indicate the character in question and the high 8 bits are either EncodeCharacter, LeaveCharacter or DecodeCharacter.

This function corrects percent-encoded errors by interpreting every '' as meaning "%25" (all percents in the same content).

Definition at line 638 of file qurlrecode.cpp.

References decode, DecodeCharacter, QUrl::DecodeReserved, defaultActionTable, QUrl::EncodeSpaces, QUrl::FullyDecoded, maskTable(), recode(), and reservedMask.

Referenced by QUrlPrivate::appendHost(), appendToUser(), QUrlPrivate::appendUserInfo(), parseIp6(), parseIpFuture(), recodeAndAppend(), QUrlQueryPrivate::recodeFromUser(), recodeFromUser(), QUrlQueryPrivate::recodeToUser(), QUrlPrivate::setHost(), and QUrlQueryPrivate::setQuery().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: