SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Encapsulates an Internet host IP address and its names. More...
#include <rw/network/RWInetHost.h>
Public Types | |
enum | NameLookup { numeric } |
Public Member Functions | |
RWInetHost () | |
RWInetHost (unsigned long IPAddress) | |
RWInetHost (const RWCString &hostname) | |
RWInetHost (const char *) | |
void | prepare () const |
void | prepare (NameLookup lookup) const |
RWCString | getName () const |
unsigned long | getAddress () const |
RWTValVector< RWCString > | getAliases () const |
RWTValVector< unsigned long > | getAddresses () const |
RWCString | id (unsigned level=0) const |
bool | operator== (const RWInetHost &rhs) const |
bool | operator!= (const RWInetHost &rhs) const |
Static Public Member Functions | |
static RWInetHost | me () |
static RWCString | addressAsString (unsigned long IPAddress) |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &strm, const RWInetHost &host) |
Encapsulates an Internet host IP address and its names. You can construct an RWInetHost from either an IP address or a symbolic name.
RWInetHost::RWInetHost | ( | ) |
An Internet host can be specified as an actual address or through a string. The string can be either the symbolic name of the host or an IP address in dotted decimal notation. If an IP address is passed in as a long
, it must be in network byte order. The default constructor creates a special host that represents an unspecified IP address on the current machine. This is useful when constructing servers. The RWCString should contain 7-bit US-ASCII data.
RWInetHost::RWInetHost | ( | unsigned long | IPAddress | ) |
An Internet host can be specified as an actual address or through a string. The string can be either the symbolic name of the host or an IP address in dotted decimal notation. If an IP address is passed in as a long
, it must be in network byte order. The default constructor creates a special host that represents an unspecified IP address on the current machine. This is useful when constructing servers. The RWCString should contain 7-bit US-ASCII data.
RWInetHost::RWInetHost | ( | const RWCString & | hostname | ) |
An Internet host can be specified as an actual address or through a string. The string can be either the symbolic name of the host or an IP address in dotted decimal notation. If an IP address is passed in as a long
, it must be in network byte order. The default constructor creates a special host that represents an unspecified IP address on the current machine. This is useful when constructing servers. The RWCString should contain 7-bit US-ASCII data.
RWInetHost::RWInetHost | ( | const char * | ) |
An Internet host can be specified as an actual address or through a string. The string can be either the symbolic name of the host or an IP address in dotted decimal notation. If an IP address is passed in as a long
, it must be in network byte order. The default constructor creates a special host that represents an unspecified IP address on the current machine. This is useful when constructing servers. The RWCString should contain 7-bit US-ASCII data.
static RWCString RWInetHost::addressAsString | ( | unsigned long | IPAddress | ) | [static] |
Takes an address in network byte order and returns the dotted decimal string representation of the address. To go from a dotted decimal string to an address, build an RWInetHost object from the dotted decimal string. The RWCString should contain 7-bit US-ASCII data.
unsigned long RWInetHost::getAddress | ( | ) | const |
Returns the primary IP address for this host entry in network byte order. If you want to print out an IP address, use the addressAsString() static member function.
RWTValVector<unsigned long> RWInetHost::getAddresses | ( | ) | const |
Returns a list of addresses for this host entry. Addresses are returned in network byte order. If you want to print out an IP address, use the addressAsString() static member function. The primary address is the first entry in the addresses() array. This call may block if prepare() has not been called.
RWTValVector<RWCString> RWInetHost::getAliases | ( | ) | const |
Returns the list of aliases for this host entry. The official name is not included in the list of aliases. This call may block if prepare() has not been called. The RWCString should contain 7-bit US-ASCII data.
RWCString RWInetHost::getName | ( | ) | const |
RWCString RWInetHost::id | ( | unsigned | level = 0 |
) | const |
Returns a string describing self. The verbosity of the output is controlled by level where level=0
is the most basic output, and level=9
is the most verbose. The RWCString should contain 7-bit US-ASCII data.
static RWInetHost RWInetHost::me | ( | ) | [static] |
Returns the host object for the host on which this program is currently running.
bool RWInetHost::operator!= | ( | const RWInetHost & | rhs | ) | const |
Returns true
if the two host objects are not equal.
bool RWInetHost::operator== | ( | const RWInetHost & | rhs | ) | const |
Returns true
if the two host objects are equal.
void RWInetHost::prepare | ( | NameLookup | lookup | ) | const |
void RWInetHost::prepare | ( | ) | const |
std::ostream & operator<< | ( | std::ostream & | strm, | |
const RWInetHost & | host | |||
) | [related] |
Outputs a representation of host on strm. The representation is generated using the member function host.id() with level=0
.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.