Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
FBB::Hostname(3bobcat)		   Host	Info		FBB::Hostname(3bobcat)

NAME
       FBB::Hostname - Contains	name/address info about	a host

SYNOPSIS
       #include	<bobcat/hostname>
       Linking option: -lbobcat

DESCRIPTION
       FBB::Hostname  objects  inherit	from  Hostent,	and offers information
       about a host, like Hostent. Apart from being initialized	by a  hostname
       or host address,	they can also be initialized by	a FBB::InetAddress ob-
       ject. Most of the functionality of an FBB::Hostname object is available
       through its parent-class	FBB::Hostent.

NAMESPACE
       FBB
       All  constructors,  members,  operators	and manipulators, mentioned in
       this man-page, are defined in the namespace FBB.

INHERITS FROM
       FBB::Hostent

CONSTRUCTORS
       o      Hostname():
	      The default constructor initializes an empty  FBB::Hostname  ob-
	      ject.

       o      Hostname((std::string const &host)):
	      This  constructor	 initializes  an  FBB::Hostname	 object	from a
	      string representing the name or  dotted  decimal	address	 of  a
	      host.  An	FBB::Exception object is thrown	if the hostname	infor-
	      mation could not be retrieved.

       o      Hostname(InetAddress const &inetAddress):
	      This constructor initializes an FBB::Hostname object from	an In-
	      etAddress	 object.  An  FBB::Exception  object  is thrown	if the
	      hostname information could not be	retrieved.  The	copy construc-
	      tor is available.

MEMBER FUNCTIONS
       All  members  of	 FBB::Hostent are available, as	FBB::Hostname inherits
       from this class.	There are no additional	members.

EXAMPLE
       #include	<iostream>

       #include	<bobcat/hostname>
       #include	<bobcat/errno>

       using namespace std;
       using namespace FBB;

       int main(int argc, char **argv)
       {
	   while (true)
	   {
	       cout << "Enter name or address:\n";

	       string str;

	       if (!getline(cin, str))
		   return 0;

	       if (str == "")
		   break;

	       try
	       {
		   Hostname h(str);

		   cout	<< "Official name:\n";
		       cout << h.hostname() << endl;

		   cout	<< "Aliases:\n";
		   for (size_t idx = 0;	idx < h.nAliases(); idx++)
		       cout << h.alias(idx) << " ";
		   cout	<< endl;

		   cout	<< "Adresses:\n";
		   for (size_t idx = 0;	idx < h.nAddresses(); idx++)
		       cout << h.dottedDecimalAddress(idx) << "	";
		   cout	<< endl;
	       }
	       catch (Errno const &err)
	       {
		   cout	<< err.why() <<	endl;
	       }
	   }
	   return 0;
       }

FILES
       bobcat/hostname - defines the class interface

SEE ALSO
       bobcat(7), hostent(3bobcat)

BUGS
       None Reported.

DISTRIBUTION FILES
       o      bobcat_3.25.01-x.dsc: detached signature;

       o      bobcat_3.25.01-x.tar.gz: source archive;

       o      bobcat_3.25.01-x_i386.changes: change log;

       o      libbobcat1_3.25.01-x_*.deb:  debian  package  holding  the   li-
	      braries;

       o      libbobcat1-dev_3.25.01-x_*.deb:  debian  package holding the li-
	      braries, headers and manual pages;

       o      http://sourceforge.net/projects/bobcat: public archive location;

BOBCAT
       Bobcat is an acronym of `Brokken's Own Base Classes And Templates'.

COPYRIGHT
       This is free software, distributed under	the terms of the  GNU  General
       Public License (GPL).

AUTHOR
       Frank B.	Brokken	(f.b.brokken@rug.nl).

libbobcat-dev_3.25.01-x.tar.gz	   2005-2015		FBB::Hostname(3bobcat)

NAME | SYNOPSIS | DESCRIPTION | NAMESPACE | INHERITS FROM | CONSTRUCTORS | MEMBER FUNCTIONS | EXAMPLE | FILES | SEE ALSO | BUGS | DISTRIBUTION FILES | BOBCAT | COPYRIGHT | AUTHOR

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=hostname&sektion=3bobcat&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help