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
QIPAddressUtils Namespace Reference

Typedefs

typedef QVarLengthArray< char, 64 > Buffer
 
typedef quint32 IPv4Address
 
typedef quint8 IPv6Address[16]
 

Functions

static QString number (quint8 val)
 
static const QCharcheckedToAscii (Buffer &buffer, const QChar *begin, const QChar *end)
 
static bool parseIp4Internal (IPv4Address &address, const char *ptr, bool acceptLeadingZero)
 
bool parseIp4 (IPv4Address &address, const QChar *begin, const QChar *end)
 
void toString (QString &appendTo, IPv4Address address)
 
const QCharparseIp6 (IPv6Address &address, const QChar *begin, const QChar *end)
 
static QChar toHex (uchar c)
 
void toString (QString &appendTo, const IPv6Address address)
 

Typedef Documentation

◆ Buffer

Definition at line 22 of file qipaddress.cpp.

◆ IPv4Address

Definition at line 25 of file qipaddress_p.h.

◆ IPv6Address

typedef quint8 QIPAddressUtils::IPv6Address[16]

Definition at line 26 of file qipaddress_p.h.

Function Documentation

◆ checkedToAscii()

static const QChar * QIPAddressUtils::checkedToAscii ( Buffer & buffer,
const QChar * begin,
const QChar * end )
static

Definition at line 23 of file qipaddress.cpp.

References begin().

Referenced by parseIp4(), and parseIp6().

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

◆ number()

static QString QIPAddressUtils::number ( quint8 val)
static

Definition at line 16 of file qipaddress.cpp.

References QStringLiteral, qulltoa(), and zero.

+ Here is the call graph for this function:

◆ parseIp4()

Q_CORE_EXPORT bool QIPAddressUtils::parseIp4 ( IPv4Address & address,
const QChar * begin,
const QChar * end )

Definition at line 42 of file qipaddress.cpp.

References begin(), checkedToAscii(), parseIp4Internal(), ptr(), and Q_ASSERT.

Referenced by QHostAddressPrivate::parse(), and QUrlPrivate::setHost().

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

◆ parseIp4Internal()

static bool QIPAddressUtils::parseIp4Internal ( IPv4Address & address,
const char * ptr,
bool acceptLeadingZero )
static

Definition at line 53 of file qipaddress.cpp.

References ptr(), qstrlen(), and qstrntoull().

Referenced by parseIp4(), and parseIp6().

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

◆ parseIp6()

Q_CORE_EXPORT const QChar * QIPAddressUtils::parseIp6 ( IPv6Address & address,
const QChar * begin,
const QChar * end )
Since
5.0

Parses one IPv6 address from begin to end and stores the representation in address. Returns null if everything was parsed correctly, or the pointer to the first bad character where parsing failed. If the parsing failed for a reason not related to a particular character, returns end.

Definition at line 114 of file qipaddress.cpp.

References begin(), checkedToAscii(), nullptr, parseIp4Internal(), pos, ptr(), Q_ASSERT, qstrntoull(), and ret.

Referenced by isIp6(), parseIp6(), and parseIp6().

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

◆ toHex()

static QChar QIPAddressUtils::toHex ( uchar c)
inlinestatic

Definition at line 215 of file qipaddress.cpp.

References QtMiscUtils::toHexLower().

Referenced by toString().

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

◆ toString() [1/2]

Q_CORE_EXPORT void QIPAddressUtils::toString ( QString & appendTo,
const IPv6Address address )

Definition at line 220 of file qipaddress.cpp.

References QString::append(), i, j, QString::reserve(), QString::size(), toHex(), and toString().

+ Here is the call graph for this function:

◆ toString() [2/2]

Q_CORE_EXPORT void QIPAddressUtils::toString ( QString & appendTo,
IPv4Address address )

Definition at line 94 of file qipaddress.cpp.

References number.

Referenced by parseIp6(), QUrlPrivate::setHost(), QHostAddress::toString(), and toString().

+ Here is the caller graph for this function: