FX::QHostAddress Class Reference

#include <QHostAddress.h>

List of all members.


Detailed Description

A container holding an IPv4 or IPv6 address (Qt compatible).

This is a Qt compatible IP address container capable of working transparently with IPv4 and IPv6 addresses. It has no network knowledge and so cannot be more intelligent than what the IP specification rules permit (eg; it can't tell if an IPv4 and IPv6 addresses refer to the same machine).

An IPv4 address is 32 bits long whereas IPv6, a substantial improvement over IPv4, is up to 128 bits long (though it can vary). A discussion of IP is beyond the scope of this page, there are hundreds of books and RFC's about the matter which you should consult.

Some mapping though is provided. IPv4 maps to IPv6 where an IPv4 address AA.BB.CC.DD (if the numbers were in hex) becomes in IPv6 FFFF:AABB:CCDD. Also loopback is treated specially: 127.0.0.1 is equivalent to ::1 and vice versa. In the comparison operators, 0.0.0.0 is treated as being equivalent to loopback.

See FX::QHostAddressDict for a linear access time dictionary of QHostAddresses. You may also wish to consult FX::Maths::Vector<> for enhanced bit operations for when working with IPv6 addresses.

Definition at line 64 of file QHostAddress.h.

Public Member Functions

 QHostAddress ()
 QHostAddress (FXuint ip4addr)
 QHostAddress (const Maths::Vector< FXuchar, 16 > &ip6addr)
 QHostAddress (const FXuchar *ip6addr)
 QHostAddress (const QHostAddress &o)
QHostAddressoperator= (const QHostAddress &o)
 ~QHostAddress ()
bool operator! () const
bool operator== (const QHostAddress &o) const
bool operator!= (const QHostAddress &o) const
bool operator< (const QHostAddress &o) const
bool operator> (const QHostAddress &o) const
bool operator<= (const QHostAddress &o) const
bool operator>= (const QHostAddress &o) const
QHostAddress operator & (const QHostAddress &o) const
QHostAddress operator| (const QHostAddress &o) const
QHostAddress operator^ (const QHostAddress &o) const
void setAddress (FXuint ip4addr)
void setAddress (const Maths::Vector< FXuchar, 16 > &ip6addr)
void setAddress (const FXuchar *ip6addr)
bool setAddress (const FXString &addr)
bool isNull () const
bool isIp4Addr () const
FXuint ip4Addr () const
bool isIp6Addr () const
const Maths::Vector< FXuchar, 16 > & ip6Addr () const
const FXucharip6AddrData () const
FXString toString () const
bool isLocalMachine () const

Friends

FXAPIR FXStreamoperator<< (FXStream &s, const QHostAddress &i)
FXAPIR FXStreamoperator>> (FXStream &s, QHostAddress &i)


The documentation for this class was generated from the following file:
(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:37:38 2009 for TnFOX by doxygen v1.4.7