FBB::Hostname(3bobcat)
π FBB::Hostname β from the 3bobcat manual, bestie edition π
okay so quick vibe check: this page lives in the 3bobcat section of the manual, and it's literally all about knowing who a host is. name? address? aliases? we got all of it. let's gooo π¦
β¨ NAME β¨
FBB::Hostname β the little class that holds name/address info about a host. it's giving "who are you and where do you live" but for computers π«Ά
β¨ SYNOPSIS β¨
#include <bobcat/hostname>
Linking option: -lbobcat
so you pull in the header, and when you link, you tack on -lbobcat. that's it, that's the whole ritual πΈ
β¨ DESCRIPTION β¨
FBB::Hostname objects inherit from Hostent, and they hand you info about a host β just like Hostent does. the cute part: besides getting initialized from a hostname or a host address, you can also spin one up from an FBB::InetAddress object. and ngl, most of the stuff an FBB::Hostname can do is coming straight from its parent class FBB::Hostent. so Hostent is the main character here and Hostname is its adorable sidekick π
β¨ NAMESPACE β¨
FBB
every single constructor, member, operator and manipulator mentioned on this man-page is defined in the namespace FBB. no cap. π
β¨ INHERITS FROM β¨
FBB::Hostent
yup, it's a Hostent at heart. family tree = iconic π
β¨ CONSTRUCTORS β¨
Hostname()β the default constructor. it initializes an emptyFBB::Hostnameobject. empty as in, no thoughts, head empty πHostname(std::string const &host)β this one initializes anFBB::Hostnameobject from a string that represents the name or the dotted decimal address of a host. and heads up bestie: if the hostname info could not be retrieved, anFBB::Exceptionobject gets thrown. so wrap it, okay? πHostname(InetAddress const &inetAddress)β this one initializes anFBB::Hostnameobject from anInetAddressobject. same deal: if the hostname information could not be retrieved, anFBB::Exceptionobject is thrown. respect the try/catch, fr fr π
Copy and move constructors (and assignment operators) are available β so copying and moving these around? slay, permitted, encouraged. β¨
β¨ MEMBER FUNCTIONS β¨
every single member of FBB::Hostent is available to you, because FBB::Hostname inherits from that class. and guess what β there are no additional members. that's right, zero extra. it's purely a nepo baby who inherited everything ππ
β¨ EXAMPLE β¨
here's a little interactive toy that keeps asking you for a name or an address and then spills the tea about that host:
#include <iostream>
#include <bobcat/hostname>
#include <bobcat/exception>
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 (exception const &err)
{
cout << err.what() << endl;
}
}
}
(and yes, the Adresses: line is spelled exactly like that β we do not touch the code, periodt. π₯)
it loops forever, reads a line, bails out on EOF by returning 0, and breaks out of the loop when you just hit enter on an empty string. otherwise it builds a Hostname from whatever you typed and prints the official name, then every alias, then every dotted decimal address. and if anything blows up, the catch prints err.what() instead of crying about it. self-care π
β¨ FILES β¨
bobcat/hostnameβ defines the class interface π
β¨ SEE ALSO β¨
go read those too, bestie, they're the whole friend group π«Ά
β¨ BUGS β¨
None Reported. and honestly? iconic behaviour. no bugs, no drama, we love to see it πβ¨
β¨ BOBCAT PROJECT FILES β¨
https://fbb-git.gitlab.io/bobcat/: the gitlab project page β¨
Debian Bobcat project files:
libbobcat6: the debian package containing the shared library, changelog and copyright note π¦libbobcat-dev: the debian package containing the static library, headers, manual pages, and developer info π
β¨ BOBCAT β¨
Bobcat is an acronym of `Brokkenβs Own Base Classes And Templatesβ. π± (yeah, that's the whole name and it ate.)
β¨ COPYRIGHT β¨
This is free software, distributed under the terms of the GNU General Public License (GPL). free as in freedom, bestie ποΈβ¨
β¨ AUTHOR β¨
Frank B. Brokken (f.b.brokken@rug.nl). the legend himself π
and that's the whole page, babes π
this came to you from libbobcat-dev_6.15.01, dated 2005-2026, filed under FBB::Hostname(3bobcat) β mwah, go forth and resolve some hostnames πππΈ
π¦ where this page comes from
- ubuntu stonking: libbobcat-dev 6.15.01-1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms