.TH "FBB::Hostname" "3bobcat" "2005\-2023" "libbobcat\-dev_6\&.04\&.00" "Host Info" .PP .SH "NAME" FBB::Hostname \- Contains name/address info about a host .PP .SH "SYNOPSIS" \fB#include \fP .br Linking option: \fI\-lbobcat\fP .PP .SH "DESCRIPTION" \fBFBB::Hostname\fP objects inherit from \fIHostent\fP, and offers information about a host, like \fBHostent\fP\&. Apart from being initialized by a hostname or host address, they can also be initialized by a \fBFBB::InetAddress\fP object\&. Most of the functionality of an \fBFBB::Hostname\fP object is available through its parent\-class \fBFBB::Hostent\fP\&. .PP .SH "NAMESPACE" \fBFBB\fP .br All constructors, members, operators and manipulators, mentioned in this man\-page, are defined in the namespace \fBFBB\fP\&. .PP .SH "INHERITS FROM" \fBFBB::Hostent\fP .PP .SH "CONSTRUCTORS" .IP o \fBHostname()\fP: .br The default constructor initializes an empty \fBFBB::Hostname\fP object\&. .IP o \fBHostname((std::string const &host))\fP: .br This constructor initializes an \fBFBB::Hostname\fP object from a string representing the name or dotted decimal address of a host\&. An \fBFBB::Exception\fP object is thrown if the hostname information could not be retrieved\&. .IP o \fBHostname(InetAddress const &inetAddress)\fP: .br This constructor initializes an \fBFBB::Hostname\fP object from an \fBInetAddress\fP object\&. An \fBFBB::Exception\fP object is thrown if the hostname information could not be retrieved\&. .PP Copy and move constructors (and assignment operators) are available\&. .PP .SH "MEMBER FUNCTIONS" All members of \fBFBB::Hostent\fP are available, as \fBFBB::Hostname\fP inherits from this class\&. There are no additional members\&. .PP .SH "EXAMPLE" .nf #include #include #include using namespace std; using namespace FBB; int main(int argc, char **argv) { while (true) { cout << \(dq\&Enter name or address:\en\(dq\&; string str; if (!getline(cin, str)) return 0; if (str == \(dq\&\(dq\&) break; try { Hostname h(str); cout << \(dq\&Official name:\en\(dq\&; cout << h\&.hostname() << endl; cout << \(dq\&Aliases:\en\(dq\&; for (size_t idx = 0; idx < h\&.nAliases(); idx++) cout << h\&.alias(idx) << \(dq\& \(dq\&; cout << endl; cout << \(dq\&Adresses:\en\(dq\&; for (size_t idx = 0; idx < h\&.nAddresses(); idx++) cout << h\&.dottedDecimalAddress(idx) << \(dq\& \(dq\&; cout << endl; } catch (exception const &err) { cout << err\&.what() << endl; } } } .fi .PP .SH "FILES" \fIbobcat/hostname\fP \- defines the class interface .PP .SH "SEE ALSO" \fBbobcat\fP(7), \fBhostent\fP(3bobcat) .PP .SH "BUGS" None Reported\&. .PP .SH "BOBCAT PROJECT FILES" .PP .IP o \fIhttps://fbb\-git\&.gitlab\&.io/bobcat/\fP: gitlab project page; .IP o \fIbobcat_6\&.04\&.00\-x\&.dsc\fP: detached signature; .IP o \fIbobcat_6\&.04\&.00\-x\&.tar\&.gz\fP: source archive; .IP o \fIbobcat_6\&.04\&.00\-x_i386\&.changes\fP: change log; .IP o \fIlibbobcat1_6\&.04\&.00\-x_*\&.deb\fP: debian package containing the libraries; .IP o \fIlibbobcat1\-dev_6\&.04\&.00\-x_*\&.deb\fP: debian package containing the libraries, headers and manual pages; .PP .SH "BOBCAT" Bobcat is an acronym of `Brokken\(cq\&s Own Base Classes And Templates\(cq\&\&. .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP