Heart 1.4.984.b4712811
Heart is base back end library for your c++ Qt projects.
Loading...
Searching...
No Matches
QH::HostAddress Class Reference

The Host Address class this is wrapper of QHostAddress. Contains the NetworkAddress and network port. More...

#include <hostaddress.h>

Inheritance diagram for QH::HostAddress:
Inheritance graph
Collaboration diagram for QH::HostAddress:
Collaboration graph

Public Member Functions

 HostAddress ()
 HostAddress (const QHostAddress &other, int port=DEFAULT_PORT)
 HostAddress (const QString &other, int port=DEFAULT_PORT)
 HostAddress (const SpecialAddress &other, int port=DEFAULT_PORT)
 HostAddress (const HostAddress &other)
unsigned short port () const
 The port method return port of node.
void setPort (unsigned short port)
 setPort This method set new port value.
HostAddress & operator= (const HostAddress &right)
bool isValid () const
 isValid This method return true if the current network address is valid.
QString toString () const
 toString this method convert the Host Address value to string value.
QByteArray toBytes () const
 toBytes This method convert a network address to a byte array.
bool fromBytes (const QByteArray &array)
 fromBytes This method apply array object. (convert a byte array to a network address object)

Static Public Member Functions

static bool isIP (const QString &address)
 isIP This method return true if the address is valid.

Friends

QDataStream & operator<< (QDataStream &stream, const HostAddress &address)
QDataStream & operator>> (QDataStream &stream, HostAddress &address)
bool & operator== (QDataStream &stream, HostAddress &address)
bool & operator!= (QDataStream &stream, HostAddress &address)

Detailed Description

The Host Address class this is wrapper of QHostAddress. Contains the NetworkAddress and network port.

Definition at line 21 of file hostaddress.h.

Constructor & Destructor Documentation

◆ HostAddress() [1/5]

QH::HostAddress::HostAddress ( )
explicit

Definition at line 13 of file hostaddress.cpp.

Here is the caller graph for this function:

◆ HostAddress() [2/5]

QH::HostAddress::HostAddress ( const QHostAddress & other,
int port = DEFAULT_PORT )
explicit

Definition at line 17 of file hostaddress.cpp.

Here is the call graph for this function:

◆ HostAddress() [3/5]

QH::HostAddress::HostAddress ( const QString & other,
int port = DEFAULT_PORT )
explicit

Definition at line 22 of file hostaddress.cpp.

Here is the call graph for this function:

◆ HostAddress() [4/5]

QH::HostAddress::HostAddress ( const SpecialAddress & other,
int port = DEFAULT_PORT )

Definition at line 27 of file hostaddress.cpp.

Here is the call graph for this function:

◆ HostAddress() [5/5]

QH::HostAddress::HostAddress ( const HostAddress & other)

Definition at line 32 of file hostaddress.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ fromBytes()

bool QH::HostAddress::fromBytes ( const QByteArray & array)

fromBytes This method apply array object. (convert a byte array to a network address object)

Parameters
arraythis is input array.
Returns
true if array applied successful

Definition at line 70 of file hostaddress.cpp.

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

◆ isIP()

bool QH::HostAddress::isIP ( const QString & address)
static

isIP This method return true if the address is valid.

address This is string value of the network ip address.

Returns
true if the address is valid.

Definition at line 51 of file hostaddress.cpp.

Here is the caller graph for this function:

◆ isValid()

bool QH::HostAddress::isValid ( ) const

isValid This method return true if the current network address is valid.

Returns
true if the current network address is valid.

Definition at line 55 of file hostaddress.cpp.

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

◆ operator=()

HostAddress & QH::HostAddress::operator= ( const HostAddress & right)

Definition at line 44 of file hostaddress.cpp.

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

◆ port()

unsigned short QH::HostAddress::port ( ) const

The port method return port of node.

Returns
port of node.

Definition at line 36 of file hostaddress.cpp.

Here is the caller graph for this function:

◆ setPort()

void QH::HostAddress::setPort ( unsigned short port)

setPort This method set new port value.

Parameters
portThis is new value of port.

Definition at line 40 of file hostaddress.cpp.

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

◆ toBytes()

QByteArray QH::HostAddress::toBytes ( ) const

toBytes This method convert a network address to a byte array.

Returns
byte array implementation of this object.

Definition at line 63 of file hostaddress.cpp.

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

◆ toString()

QString QH::HostAddress::toString ( ) const

toString this method convert the Host Address value to string value.

Returns
string value of the HostAddress object.

Definition at line 59 of file hostaddress.cpp.

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

◆ operator!=

bool & operator!= ( QDataStream & stream,
HostAddress & address )
friend

◆ operator<<

QDataStream & operator<< ( QDataStream & stream,
const HostAddress & address )
friend

Definition at line 86 of file hostaddress.cpp.

◆ operator==

bool & operator== ( QDataStream & stream,
HostAddress & address )
friend

◆ operator>>

QDataStream & operator>> ( QDataStream & stream,
HostAddress & address )
friend

Definition at line 79 of file hostaddress.cpp.


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