DtHostNameAddress stores information on a host, input as either hostname, IP address, or both.
More...
Public Member Functions |
| | DtHostNameAddress (const MAKRti::DtString &hostName, const MAKRti::DtInetAddr &addr, bool skipLookup=false) |
| | Input both hostname and address.
|
| | DtHostNameAddress (const MAKRti::DtString &address) |
| | Input either ipstring or hostname string.
|
| | DtHostNameAddress (const DtHostNameAddress &orig) |
| | copy constructor
|
| virtual | ~DtHostNameAddress () |
| virtual bool | operator< (const DtHostNameAddress &other) const |
| | Less than, if address has been resolved to (or input as) an IP will just compare the IP number (Ipv4 or Ipv6).
|
| virtual bool | operator== (const DtHostNameAddress &other) const |
| | Equals operator.
|
| virtual bool | operator!= (const DtHostNameAddress &other) const |
| | Not equals operator.
|
| virtual DtHostNameAddress & | operator= (const DtHostNameAddress &other) |
| | Assignment operator.
|
| virtual const MAKRti::DtInetAddr & | ip () const |
| | Get IP address represented by this, returns 0 if error, unresolvable.
|
| virtual void | setIp (const MAKRti::DtInetAddr &newIp) |
| | Sets the IP address. Will not affect the hostname.
|
| virtual const MAKRti::DtString & | hostName () const |
| | Get the hostname represented by this, returns "" if error, can't look up.
|
| virtual void | setHostName (const MAKRti::DtString &newHostName, bool skipLookup=false) |
| | Sets the hostname.
|
| virtual const MAKRti::DtString & | compareHostName () const |
| | Return the hostname that should be used for comparison's sake.
|
| virtual bool | isAnyAddress () const |
| | Is IP the isAny value?
|
| virtual bool | isLocal () const |
| | Is this host a local interface.
|
Protected Member Functions |
| virtual MAKRti::DtInetAddr | setHostFromString (const MAKRti::DtString &newAddr) |
| | Set the hostname from the given string and return the address resolved from it.
|
| virtual void | setStatus () |
| | Determines and sets whether the current IP isAny and if ip/host are local.
|
| virtual MAKRti::DtInetAddr | dottedStringToAddress (const MAKRti::DtString &address, MAKRti::DtInetUtils::DtInetAddrFamily family) |
| | Convert a dotted string address to an IP.
|
Detailed Description
DtHostNameAddress stores information on a host, input as either hostname, IP address, or both.
Constructor & Destructor Documentation
| DtHostNameAddress::DtHostNameAddress |
( |
const MAKRti::DtString & |
hostName, |
|
|
const MAKRti::DtInetAddr & |
addr, |
|
|
bool |
skipLookup = false |
|
) |
| |
Input both hostname and address.
| DtHostNameAddress::DtHostNameAddress |
( |
const MAKRti::DtString & |
address | ) |
|
Input either ipstring or hostname string.
| virtual DtHostNameAddress::~DtHostNameAddress |
( |
| ) |
|
|
virtual |
| DtHostNameAddress::DtHostNameAddress |
( |
| ) |
|
|
private |
Member Function Documentation
| virtual const MAKRti::DtString& DtHostNameAddress::compareHostName |
( |
| ) |
const |
|
virtual |
Return the hostname that should be used for comparison's sake.
| virtual MAKRti::DtInetAddr DtHostNameAddress::dottedStringToAddress |
( |
const MAKRti::DtString & |
address, |
|
|
MAKRti::DtInetUtils::DtInetAddrFamily |
family |
|
) |
| |
|
protectedvirtual |
Convert a dotted string address to an IP.
Returns INADDR_ANY if not a dotted string.
| virtual const MAKRti::DtString& DtHostNameAddress::hostName |
( |
| ) |
const |
|
virtual |
Get the hostname represented by this, returns "" if error, can't look up.
| virtual const MAKRti::DtInetAddr& DtHostNameAddress::ip |
( |
| ) |
const |
|
virtual |
Get IP address represented by this, returns 0 if error, unresolvable.
| virtual bool DtHostNameAddress::isAnyAddress |
( |
| ) |
const |
|
virtual |
| virtual bool DtHostNameAddress::isLocal |
( |
| ) |
const |
|
virtual |
Is this host a local interface.
Not equals operator.
See note in operator< comments for parameters which are used in comparison.
Less than, if address has been resolved to (or input as) an IP will just compare the IP number (Ipv4 or Ipv6).
Equals operator.
See note in operator< comments for parameters which are used in comparison.
| virtual MAKRti::DtInetAddr DtHostNameAddress::setHostFromString |
( |
const MAKRti::DtString & |
newAddr | ) |
|
|
protectedvirtual |
Set the hostname from the given string and return the address resolved from it.
| virtual void DtHostNameAddress::setHostName |
( |
const MAKRti::DtString & |
newHostName, |
|
|
bool |
skipLookup = false |
|
) |
| |
|
virtual |
Sets the hostname.
If IP is already set, will not reset. If not, will try to look up the IP based on the hostname.
| virtual void DtHostNameAddress::setIp |
( |
const MAKRti::DtInetAddr & |
newIp | ) |
|
|
virtual |
Sets the IP address. Will not affect the hostname.
| virtual void DtHostNameAddress::setStatus |
( |
| ) |
|
|
protectedvirtual |
Determines and sets whether the current IP isAny and if ip/host are local.
Member Data Documentation
| MAKRti::DtString DtHostNameAddress::myCaseInsensitiveHostname |
|
protected |
Case insensitive hostname, for comparison.
| MAKRti::DtInetAddr DtHostNameAddress::myHostIp |
|
protected |
| MAKRti::DtString DtHostNameAddress::myHostName |
|
protected |
| bool DtHostNameAddress::myIsLocal |
|
protected |
Does this represent a local address.
The documentation for this class was generated from the following file: