Eneboo - Documentación para desarrolladores
Métodos públicos
Referencia de la Clase QHostAddress

The QHostAddress class provides an IP address.network. Más...

#include <qhostaddress.h>

Lista de todos los miembros.

Métodos públicos

 QHostAddress ()
 QHostAddress (Q_UINT32 ip4Addr)
 QHostAddress (Q_UINT8 *ip6Addr)
 QHostAddress (const Q_IPV6ADDR &ip6Addr)
 QHostAddress (const QString &address)
 QHostAddress (const QHostAddress &)
virtual ~QHostAddress ()
QHostAddressoperator= (const QHostAddress &)
void setAddress (Q_UINT32 ip4Addr)
void setAddress (Q_UINT8 *ip6Addr)
bool setAddress (const QString &address)
bool isIp4Addr () const
Q_UINT32 ip4Addr () const
bool isIPv4Address () const
Q_UINT32 toIPv4Address () const
bool isIPv6Address () const
Q_IPV6ADDR toIPv6Address () const
QString toString () const
bool operator== (const QHostAddress &) const
bool isNull () const
 QHostAddress ()
 QHostAddress (Q_UINT32 ip4Addr)
 QHostAddress (Q_UINT8 *ip6Addr)
 QHostAddress (const Q_IPV6ADDR &ip6Addr)
 QHostAddress (const QString &address)
 QHostAddress (const QHostAddress &)
virtual ~QHostAddress ()
QHostAddressoperator= (const QHostAddress &)
void setAddress (Q_UINT32 ip4Addr)
void setAddress (Q_UINT8 *ip6Addr)
bool setAddress (const QString &address)
bool isIp4Addr () const
Q_UINT32 ip4Addr () const
bool isIPv4Address () const
Q_UINT32 toIPv4Address () const
bool isIPv6Address () const
Q_IPV6ADDR toIPv6Address () const
QString toString () const
bool operator== (const QHostAddress &) const
bool isNull () const

Descripción detallada

The QHostAddress class provides an IP address.

network.

This class contains an IP address in a platform and protocol independent manner. It stores both IPv4 and IPv6 addresses in a way that you can easily access on any platform.

QHostAddress is normally used with the classes QSocket, QServerSocket and QSocketDevice to set up a server or to connect to a host.

Host addresses may be set with setAddress() and retrieved with ip4Addr() or toString().

Ver también:
QSocket, QServerSocket, QSocketDevice

Documentación del constructor y destructor

QHostAddress::QHostAddress ( )

Creates a host address object with the IP address 0.0.0.0.

QHostAddress::QHostAddress ( Q_UINT32  ip4Addr)

Creates a host address object for the IPv4 address ip4Addr.

QHostAddress::QHostAddress ( Q_UINT8 *  ip6Addr)

Creates a host address object with the specified IPv6 address.

ip6Addr must be a 16 byte array in network byte order (high-order byte first).

QHostAddress::QHostAddress ( const Q_IPV6ADDR ip6Addr)

Creates a host address object with the IPv6 address, ip6Addr.

QHostAddress::QHostAddress ( const QString address)
QHostAddress::QHostAddress ( const QHostAddress address)

Creates a copy of address.

QHostAddress::~QHostAddress ( ) [virtual]

Destroys the host address object.

QHostAddress::QHostAddress ( )
QHostAddress::QHostAddress ( Q_UINT32  ip4Addr)
QHostAddress::QHostAddress ( Q_UINT8 *  ip6Addr)
QHostAddress::QHostAddress ( const Q_IPV6ADDR ip6Addr)
QHostAddress::QHostAddress ( const QString address)
QHostAddress::QHostAddress ( const QHostAddress )
virtual QHostAddress::~QHostAddress ( ) [virtual]

Documentación de las funciones miembro

Q_UINT32 QHostAddress::ip4Addr ( ) const

Use toIPv4Address() instead.

Q_UINT32 QHostAddress::ip4Addr ( ) const
bool QHostAddress::isIp4Addr ( ) const
bool QHostAddress::isIp4Addr ( ) const

Use isIPv4Address() instead.

bool QHostAddress::isIPv4Address ( ) const
bool QHostAddress::isIPv4Address ( ) const

Returns TRUE if the host address represents an IPv4 address; otherwise returns FALSE.

bool QHostAddress::isIPv6Address ( ) const

Returns TRUE if the host address represents an IPv6 address; otherwise returns FALSE.

bool QHostAddress::isIPv6Address ( ) const
bool QHostAddress::isNull ( ) const

Returns TRUE if this host address is null (INADDR_ANY or in6addr_any). The default constructor creates a null address, and that address isn't valid for any particular host or interface.

bool QHostAddress::isNull ( ) const
QHostAddress & QHostAddress::operator= ( const QHostAddress address)

Assigns another host address object address to this object and returns a reference to this object.

QHostAddress& QHostAddress::operator= ( const QHostAddress )
bool QHostAddress::operator== ( const QHostAddress other) const

Returns TRUE if this host address is the same as other; otherwise returns FALSE.

bool QHostAddress::operator== ( const QHostAddress ) const
bool QHostAddress::setAddress ( const QString address)
void QHostAddress::setAddress ( Q_UINT8 *  ip6Addr)
void QHostAddress::setAddress ( Q_UINT8 *  ip6Addr)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Set the IPv6 address specified by ip6Addr.

ip6Addr must be a 16 byte array in network byte order (high-order byte first).

bool QHostAddress::setAddress ( const QString address)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the IPv4 or IPv6 address specified by the string representation address (e.g. "127.0.0.1"). Returns TRUE and sets the address if the address was successfully parsed; otherwise returns FALSE and leaves the address unchanged.

void QHostAddress::setAddress ( Q_UINT32  ip4Addr)

Set the IPv4 address specified by ip4Addr.

void QHostAddress::setAddress ( Q_UINT32  ip4Addr)
Q_UINT32 QHostAddress::toIPv4Address ( ) const
Q_UINT32 QHostAddress::toIPv4Address ( ) const

Returns the IPv4 address as a number.

For example, if the address is 127.0.0.1, the returned value is 2130706433 (i.e. 0x7f000001).

This value is only valid when isIp4Addr() returns TRUE.

Ver también:
toString()
Q_IPV6ADDR QHostAddress::toIPv6Address ( ) const
Q_IPV6ADDR QHostAddress::toIPv6Address ( ) const

Returns the IPv6 address as a Q_IPV6ADDR structure. The structure consists of 16 unsigned characters.

        Q_IPV6ADDR addr = hostAddr.ip6Addr();
        // addr.c[] contains 16 unsigned characters

        for (int i = 0; i < 16; ++i) {
            // process addr.c[i]
        }

This value is only valid when isIPv6Address() returns TRUE.

Ver también:
toString()
QString QHostAddress::toString ( ) const
QString QHostAddress::toString ( ) const

Returns the address as a string.

For example, if the address is the IPv4 address 127.0.0.1, the returned string is "127.0.0.1".

Ver también:
ip4Addr()

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'