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
QUrlPrivate Class Reference
+ Collaboration diagram for QUrlPrivate:

Classes

struct  Error
 

Public Types

enum  Section : uchar {
  Scheme = 0x01 , UserName = 0x02 , Password = 0x04 , UserInfo = UserName | Password ,
  Host = 0x08 , Port = 0x10 , Authority = UserInfo | Host | Port , Path = 0x20 ,
  Hierarchy = Authority | Path , Query = 0x40 , Fragment = 0x80 , FullUrl = 0xff
}
 
enum  Flags : uchar { IsLocalFile = 0x01 }
 
enum  ErrorCode {
  InvalidSchemeError = Scheme << 8 , InvalidUserNameError = UserName << 8 , InvalidPasswordError = Password << 8 , InvalidRegNameError = Host << 8 ,
  InvalidIPv4AddressError , InvalidIPv6AddressError , InvalidCharacterInIPv6Error , InvalidIPvFutureError ,
  HostMissingEndBracket , InvalidPortError = Port << 8 , PortEmptyError , InvalidPathError = Path << 8 ,
  InvalidQueryError = Query << 8 , InvalidFragmentError = Fragment << 8 , AuthorityPresentAndPathIsRelative = Authority << 8 | Path << 8 | 0x10000 , AuthorityAbsentAndPathIsDoubleSlash ,
  RelativeUrlPathContainsColonBeforeSlash = Scheme << 8 | Authority << 8 | Path << 8 | 0x10000 , NoError = 0
}
 

Public Member Functions

 QUrlPrivate ()
 
 QUrlPrivate (const QUrlPrivate &copy)
 
 ~QUrlPrivate ()
 
void parse (const QString &url, QUrl::ParsingMode parsingMode)
 
bool isEmpty () const
 
std::unique_ptr< ErrorcloneError () const
 
void clearError ()
 
void setError (ErrorCode errorCode, const QString &source, qsizetype supplement=-1)
 
ErrorCode validityError (QString *source=nullptr, qsizetype *position=nullptr) const
 
bool validateComponent (Section section, const QString &input, qsizetype begin, qsizetype end)
 
bool validateComponent (Section section, const QString &input)
 
void appendAuthority (QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const
 
void appendUserInfo (QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const
 
void appendUserName (QString &appendTo, QUrl::FormattingOptions options) const
 
void appendPassword (QString &appendTo, QUrl::FormattingOptions options) const
 
void appendHost (QString &appendTo, QUrl::FormattingOptions options) const
 
void appendPath (QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const
 
void appendQuery (QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const
 
void appendFragment (QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const
 
bool setScheme (const QString &value, qsizetype len, bool doSetError)
 
void setAuthority (const QString &auth, qsizetype from, qsizetype end, QUrl::ParsingMode mode)
 
void setUserInfo (const QString &userInfo, qsizetype from, qsizetype end)
 
void setUserName (const QString &value, qsizetype from, qsizetype end)
 
void setPassword (const QString &value, qsizetype from, qsizetype end)
 
bool setHost (const QString &value, qsizetype from, qsizetype end, QUrl::ParsingMode mode)
 
void setPath (const QString &value, qsizetype from, qsizetype end)
 
void setQuery (const QString &value, qsizetype from, qsizetype end)
 
void setFragment (const QString &value, qsizetype from, qsizetype end)
 
bool hasScheme () const
 
bool hasAuthority () const
 
bool hasUserInfo () const
 
bool hasUserName () const
 
bool hasPassword () const
 
bool hasHost () const
 
bool hasPort () const
 
bool hasPath () const
 
bool hasQuery () const
 
bool hasFragment () const
 
bool isLocalFile () const
 
QString toLocalFile (QUrl::FormattingOptions options) const
 
QString mergePaths (const QString &relativePath) const
 

Public Attributes

QAtomicInt ref
 
int port
 
QString scheme
 
QString userName
 
QString password
 
QString host
 
QString path
 
QString query
 
QString fragment
 
std::unique_ptr< Errorerror
 
uchar sectionIsPresent
 
uchar flags
 

Detailed Description

Definition at line 440 of file qurl.cpp.

Member Enumeration Documentation

◆ ErrorCode

Enumerator
InvalidSchemeError 
InvalidUserNameError 
InvalidPasswordError 
InvalidRegNameError 
InvalidIPv4AddressError 
InvalidIPv6AddressError 
InvalidCharacterInIPv6Error 
InvalidIPvFutureError 
HostMissingEndBracket 
InvalidPortError 
PortEmptyError 
InvalidPathError 
InvalidQueryError 
InvalidFragmentError 
AuthorityPresentAndPathIsRelative 
AuthorityAbsentAndPathIsDoubleSlash 
RelativeUrlPathContainsColonBeforeSlash 
NoError 

Definition at line 462 of file qurl.cpp.

◆ Flags

Enumerator
IsLocalFile 

Definition at line 458 of file qurl.cpp.

◆ Section

Enumerator
Scheme 
UserName 
Password 
UserInfo 
Host 
Port 
Authority 
Path 
Hierarchy 
Query 
Fragment 
FullUrl 

Definition at line 443 of file qurl.cpp.

Constructor & Destructor Documentation

◆ QUrlPrivate() [1/2]

QUrlPrivate::QUrlPrivate ( )
inline

Definition at line 579 of file qurl.cpp.

◆ QUrlPrivate() [2/2]

QUrlPrivate::QUrlPrivate ( const QUrlPrivate & copy)
inline

Definition at line 586 of file qurl.cpp.

◆ ~QUrlPrivate()

QUrlPrivate::~QUrlPrivate ( )
inlinedefault

Member Function Documentation

◆ appendAuthority()

void QUrlPrivate::appendAuthority ( QString & appendTo,
QUrl::FormattingOptions options,
Section appendingTo ) const
inline

Definition at line 837 of file qurl.cpp.

References appendHost(), appendUserInfo(), hasPassword(), hasUserName(), QString::number(), QUrl::RemovePassword, QUrl::RemovePort, and QUrl::RemoveUserInfo.

Referenced by QUrl::authority(), and QUrl::toString().

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

◆ appendFragment()

void QUrlPrivate::appendFragment ( QString & appendTo,
QUrl::FormattingOptions options,
Section appendingTo ) const
inline

Definition at line 934 of file qurl.cpp.

References appendToUser(), QUrl::EncodeDelimiters, fragment, fragmentInIsolation, fragmentInUrl, FullUrl, and nullptr.

Referenced by QUrl::fragment(), and QUrl::toString().

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

◆ appendHost()

void QUrlPrivate::appendHost ( QString & appendTo,
QUrl::FormattingOptions options ) const
inline

Definition at line 1157 of file qurl.cpp.

References AllowLeadingDot, QString::at(), QString::detach(), QUrl::EncodeUnicode, Host, host, QString::isEmpty(), QString::isNull(), qt_ACE_do(), qt_urlRecode(), sectionIsPresent, and ToAceOnly.

Referenced by appendAuthority(), and QUrl::host().

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

◆ appendPassword()

void QUrlPrivate::appendPassword ( QString & appendTo,
QUrl::FormattingOptions options ) const
inline

Definition at line 903 of file qurl.cpp.

References appendToUser(), QUrl::EncodeDelimiters, password, passwordInIsolation, and passwordInUrl.

Referenced by QUrl::password().

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

◆ appendPath()

void QUrlPrivate::appendPath ( QString & appendTo,
QUrl::FormattingOptions options,
Section appendingTo ) const
inline

Definition at line 910 of file qurl.cpp.

References appendToUser(), QDirPrivate::DefaultNormalization, QUrl::EncodeDelimiters, FullUrl, isLocalFile(), QStringView::left(), QUrl::NormalizePathSegments, path, pathInIsolation, pathInUrl, qt_normalizePathSegments(), QDirPrivate::RemotePath, QUrl::RemoveFilename, and QUrl::StripTrailingSlash.

Referenced by QUrl::adjusted(), QUrl::matches(), QUrl::path(), toLocalFile(), and QUrl::toString().

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

◆ appendQuery()

void QUrlPrivate::appendQuery ( QString & appendTo,
QUrl::FormattingOptions options,
Section appendingTo ) const
inline

Definition at line 941 of file qurl.cpp.

References appendToUser(), QUrl::EncodeDelimiters, FullUrl, queryInIsolation, and queryInUrl.

Referenced by QUrl::query(), and QUrl::toString().

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

◆ appendUserInfo()

void QUrlPrivate::appendUserInfo ( QString & appendTo,
QUrl::FormattingOptions options,
Section appendingTo ) const
inline

Definition at line 851 of file qurl.cpp.

References Authority, QUrl::EncodeDelimiters, FullUrl, hasPassword(), hasUserInfo(), password, passwordInAuthority, passwordInUrl, passwordInUserInfo, Q_LIKELY, qt_urlRecode(), QUrl::RemovePassword, UserInfo, userName, userNameInAuthority, userNameInUrl, and userNameInUserInfo.

Referenced by appendAuthority(), and QUrl::userInfo().

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

◆ appendUserName()

void QUrlPrivate::appendUserName ( QString & appendTo,
QUrl::FormattingOptions options ) const
inline

Definition at line 896 of file qurl.cpp.

References appendToUser(), QUrl::EncodeDelimiters, userName, userNameInIsolation, and userNameInUrl.

Referenced by QUrl::userName().

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

◆ clearError()

void QUrlPrivate::clearError ( )
inline

Definition at line 609 of file qurl.cpp.

References error.

Referenced by parse(), QUrl::setAuthority(), QUrl::setFragment(), QUrl::setHost(), QUrl::setPassword(), QUrl::setPath(), QUrl::setPort(), QUrl::setQuery(), QUrl::setQuery(), QUrl::setScheme(), QUrl::setUserInfo(), and QUrl::setUserName().

+ Here is the caller graph for this function:

◆ cloneError()

std::unique_ptr< QUrlPrivate::Error > QUrlPrivate::cloneError ( ) const

Definition at line 604 of file qurl.cpp.

References error.

◆ hasAuthority()

bool QUrlPrivate::hasAuthority ( ) const
inline

Definition at line 540 of file qurl.cpp.

References Authority, and sectionIsPresent.

Referenced by QUrl::resolved(), QUrl::toString(), and validityError().

+ Here is the caller graph for this function:

◆ hasFragment()

bool QUrlPrivate::hasFragment ( ) const
inline

Definition at line 548 of file qurl.cpp.

References Fragment, and sectionIsPresent.

Referenced by QUrl::fragment(), QUrl::hasFragment(), QUrl::resolved(), and QUrl::toString().

+ Here is the caller graph for this function:

◆ hasHost()

bool QUrlPrivate::hasHost ( ) const
inline

Definition at line 544 of file qurl.cpp.

References Host, and sectionIsPresent.

◆ hasPassword()

bool QUrlPrivate::hasPassword ( ) const
inline

Definition at line 543 of file qurl.cpp.

References Password, and sectionIsPresent.

Referenced by appendAuthority(), and appendUserInfo().

+ Here is the caller graph for this function:

◆ hasPath()

bool QUrlPrivate::hasPath ( ) const
inline

Definition at line 546 of file qurl.cpp.

◆ hasPort()

bool QUrlPrivate::hasPort ( ) const
inline

Definition at line 545 of file qurl.cpp.

◆ hasQuery()

bool QUrlPrivate::hasQuery ( ) const
inline

Definition at line 547 of file qurl.cpp.

References Query, and sectionIsPresent.

Referenced by QUrl::hasQuery(), QUrl::query(), QUrl::resolved(), and QUrl::toString().

+ Here is the caller graph for this function:

◆ hasScheme()

bool QUrlPrivate::hasScheme ( ) const
inline

Definition at line 539 of file qurl.cpp.

References Scheme, and sectionIsPresent.

Referenced by QUrl::isRelative(), QUrl::resolved(), and QUrl::toString().

+ Here is the caller graph for this function:

◆ hasUserInfo()

bool QUrlPrivate::hasUserInfo ( ) const
inline

Definition at line 541 of file qurl.cpp.

References sectionIsPresent, and UserInfo.

Referenced by appendUserInfo().

+ Here is the caller graph for this function:

◆ hasUserName()

bool QUrlPrivate::hasUserName ( ) const
inline

Definition at line 542 of file qurl.cpp.

References sectionIsPresent, and UserName.

Referenced by appendAuthority().

+ Here is the caller graph for this function:

◆ isEmpty()

bool QUrlPrivate::isEmpty ( ) const
inline

Definition at line 507 of file qurl.cpp.

References sectionIsPresent.

Referenced by QUrl::isEmpty(), and QUrl::matches().

+ Here is the caller graph for this function:

◆ isLocalFile()

bool QUrlPrivate::isLocalFile ( ) const
inline

Definition at line 550 of file qurl.cpp.

References IsLocalFile.

Referenced by appendPath(), and QUrl::isLocalFile().

+ Here is the caller graph for this function:

◆ mergePaths()

QString QUrlPrivate::mergePaths ( const QString & relativePath) const
inline

Definition at line 1505 of file qurl.cpp.

References host, QString::isEmpty(), and QStringView::left().

Referenced by QUrl::resolved().

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

◆ parse()

void QUrlPrivate::parse ( const QString & url,
QUrl::ParsingMode parsingMode )
inline

Definition at line 1367 of file qurl.cpp.

References begin(), QString::clear(), clearError(), error, Fragment, hash, host, i, password, Query, scheme, sectionIsPresent, setAuthority(), setFragment(), setPath(), setQuery(), setScheme(), QUrl::TolerantMode, url, userName, and validateComponent().

Referenced by QUrl::operator=(), and QUrl::setUrl().

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

◆ setAuthority()

void QUrlPrivate::setAuthority ( const QString & auth,
qsizetype from,
qsizetype end,
QUrl::ParsingMode mode )
inline

Definition at line 1014 of file qurl.cpp.

References QString::clear(), Host, host, i, InvalidPortError, QtMiscUtils::isAsciiDigit(), password, sectionIsPresent, setError(), setHost(), setUserInfo(), QUrl::StrictMode, UserInfo, userName, and validateComponent().

Referenced by parse(), and QUrl::setAuthority().

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

◆ setError()

void QUrlPrivate::setError ( ErrorCode errorCode,
const QString & source,
qsizetype supplement = -1 )
inline

Definition at line 614 of file qurl.cpp.

References error.

Referenced by setAuthority(), setHost(), QUrl::setPort(), setScheme(), and validateComponent().

+ Here is the caller graph for this function:

◆ setFragment()

void QUrlPrivate::setFragment ( const QString & value,
qsizetype from,
qsizetype end )
inline

Definition at line 1115 of file qurl.cpp.

References Fragment, fragment, fragmentInIsolation, recodeFromUser(), and sectionIsPresent.

Referenced by parse(), and QUrl::setFragment().

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

◆ setHost()

bool QUrlPrivate::setHost ( const QString & value,
qsizetype from,
qsizetype end,
QUrl::ParsingMode mode )
inline

Definition at line 1274 of file qurl.cpp.

References Authority, begin(), QString::clear(), ForbidLeadingDot, Host, host, HostMissingEndBracket, QString::indexOf(), InvalidCharacterInIPv6Error, InvalidIPv6AddressError, InvalidIPvFutureError, InvalidRegNameError, NormalizeAce, QIPAddressUtils::parseIp4(), parseIp6(), parseIpFuture(), pos, qt_ACE_do(), qt_urlRecode(), sectionIsPresent, setError(), setHost(), QUrl::StrictMode, QUrl::TolerantMode, and QIPAddressUtils::toString().

Referenced by QUrl::fromLocalFile(), and QUrl::setHost().

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

◆ setPassword()

void QUrlPrivate::setPassword ( const QString & value,
qsizetype from,
qsizetype end )
inline

Definition at line 1103 of file qurl.cpp.

References Password, password, passwordInIsolation, recodeFromUser(), and sectionIsPresent.

Referenced by QUrl::setPassword(), and setUserInfo().

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

◆ setPath()

void QUrlPrivate::setPath ( const QString & value,
qsizetype from,
qsizetype end )
inline

Definition at line 1109 of file qurl.cpp.

References pathInIsolation, and recodeFromUser().

Referenced by parse(), and QUrl::setPath().

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

◆ setQuery()

void QUrlPrivate::setQuery ( const QString & value,
qsizetype from,
qsizetype end )
inline

Definition at line 1121 of file qurl.cpp.

References Query, queryInIsolation, recodeFromUser(), and sectionIsPresent.

Referenced by parse(), and QUrl::setQuery().

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

◆ setScheme()

bool QUrlPrivate::setScheme ( const QString & value,
qsizetype len,
bool doSetError )
inline

Definition at line 949 of file qurl.cpp.

References QString::clear(), QString::data(), fileScheme(), i, InvalidSchemeError, QtMiscUtils::isAsciiDigit(), QtMiscUtils::isAsciiLower(), QtMiscUtils::isAsciiUpper(), IsLocalFile, QString::left(), Scheme, scheme, sectionIsPresent, setError(), and webDavScheme().

Referenced by parse(), and QUrl::setScheme().

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

◆ setUserInfo()

void QUrlPrivate::setUserInfo ( const QString & userInfo,
qsizetype from,
qsizetype end )
inline

Definition at line 1084 of file qurl.cpp.

References QString::clear(), QString::indexOf(), password, sectionIsPresent, setPassword(), and setUserName().

Referenced by setAuthority(), and QUrl::setUserInfo().

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

◆ setUserName()

void QUrlPrivate::setUserName ( const QString & value,
qsizetype from,
qsizetype end )
inline

Definition at line 1097 of file qurl.cpp.

References recodeFromUser(), sectionIsPresent, UserName, userName, and userNameInIsolation.

Referenced by setUserInfo(), and QUrl::setUserName().

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

◆ toLocalFile()

QString QUrlPrivate::toLocalFile ( QUrl::FormattingOptions options) const

Definition at line 1470 of file qurl.cpp.

References appendPath(), host, QString::isEmpty(), Path, QString::remove(), scheme, webDavScheme(), and webDavSslTag().

Referenced by QUrl::toLocalFile(), and QUrl::toString().

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

◆ validateComponent() [1/2]

bool QUrlPrivate::validateComponent ( Section section,
const QString & input )
inline

Definition at line 515 of file qurl.cpp.

References validateComponent().

+ Here is the call graph for this function:

◆ validateComponent() [2/2]

bool QUrlPrivate::validateComponent ( QUrlPrivate::Section section,
const QString & input,
qsizetype begin,
qsizetype end )

Definition at line 1674 of file qurl.cpp.

References Authority, begin(), error, FullUrl, Hierarchy, i, InvalidPasswordError, InvalidUserNameError, isHex(), j, Q_ASSERT, setError(), and UserInfo.

Referenced by parse(), setAuthority(), QUrl::setFragment(), QUrl::setPassword(), QUrl::setPath(), QUrl::setQuery(), QUrl::setUserInfo(), QUrl::setUserName(), and validateComponent().

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

◆ validityError()

QUrlPrivate::ErrorCode QUrlPrivate::validityError ( QString * source = nullptr,
qsizetype * position = nullptr ) const
inline

Definition at line 1609 of file qurl.cpp.

References AuthorityAbsentAndPathIsDoubleSlash, AuthorityPresentAndPathIsRelative, error, hasAuthority(), Host, i, NoError, path, position(), Q_ASSERT, RelativeUrlPathContainsColonBeforeSlash, Scheme, and sectionIsPresent.

Referenced by QUrl::errorString(), and QUrl::isValid().

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

Member Data Documentation

◆ error

std::unique_ptr<Error> QUrlPrivate::error

◆ flags

uchar QUrlPrivate::flags

Definition at line 573 of file qurl.cpp.

Referenced by QUrl::resolved(), and QUrl::setScheme().

◆ fragment

◆ host

◆ password

◆ path

◆ port

int QUrlPrivate::port

◆ query

◆ ref

QAtomicInt QUrlPrivate::ref

Definition at line 555 of file qurl.cpp.

Referenced by QUrl::~QUrl(), QUrl::clear(), QUrl::isDetached(), and QUrl::operator=().

◆ scheme

◆ sectionIsPresent

◆ userName


The documentation for this class was generated from the following file: