Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
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.
 
HostAddressoperator= (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 applay array obejct. (conver a byte array to a newtwork 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 14 of file hostaddress.cpp.

◆ HostAddress() [2/5]

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

Definition at line 18 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 23 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 28 of file hostaddress.cpp.

Here is the call graph for this function:

◆ HostAddress() [5/5]

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

Definition at line 33 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 applay array obejct. (conver a byte array to a newtwork address object)

Parameters
arraythis is input array.
Returns
true if array applayed successfull

Definition at line 71 of file hostaddress.cpp.

◆ isIP()

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

isIP This method return true if the address is valid.

address This is tring value of the network ip address.

Returns
true if the address is valid.

Definition at line 52 of file hostaddress.cpp.

◆ 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 56 of file hostaddress.cpp.

Here is the call graph for this function:

◆ operator=()

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

Definition at line 45 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 37 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 41 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 64 of file hostaddress.cpp.

◆ 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 60 of file hostaddress.cpp.

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

Friends And Related Symbol Documentation

◆ operator!=

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

◆ operator<<

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

Definition at line 87 of file hostaddress.cpp.

◆ operator==

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

◆ operator>>

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

Definition at line 80 of file hostaddress.cpp.


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