Fawkes API  Fawkes Development Version
fawkes::HostInfo Class Reference

Host information. More...

#include <utils/system/hostinfo.h>

Public Member Functions

 HostInfo ()
 Constructor. More...
 
 ~HostInfo ()
 Destructor. More...
 
const char * name ()
 Get full hostname. More...
 
const char * short_name ()
 Get short hostname (up to first dot). More...
 
const char * domain ()
 Get domain name (after first dot or none if no dot in name). More...
 
const char * arch ()
 Get architecture (like i686 or x86_64). More...
 
const char * sys_name ()
 Get system name (like Linux). More...
 
const char * sys_release ()
 Get system release (kernel version on Linux). More...
 
const char * sys_version ()
 Get system version (build date on Linux). More...
 
void update ()
 Update information. More...
 

Detailed Description

Host information.

This class provides access to basic system information like hostname, domain name, architecture and system information. It's basically a C++ wrapper to the uname system call.

Author
Tim Niemueller

Definition at line 31 of file hostinfo.h.

Constructor & Destructor Documentation

◆ HostInfo()

fawkes::HostInfo::HostInfo ( )

Constructor.

Definition at line 43 of file hostinfo.cpp.

References update().

◆ ~HostInfo()

fawkes::HostInfo::~HostInfo ( )

Destructor.

Definition at line 61 of file hostinfo.cpp.

Member Function Documentation

◆ arch()

const char * fawkes::HostInfo::arch ( )

Get architecture (like i686 or x86_64).

Returns
architecture

Definition at line 134 of file hostinfo.cpp.

◆ domain()

const char * fawkes::HostInfo::domain ( )

Get domain name (after first dot or none if no dot in name).

Returns
domain name

Definition at line 124 of file hostinfo.cpp.

◆ name()

const char * fawkes::HostInfo::name ( )

Get full hostname.

Returns
hostname

Definition at line 104 of file hostinfo.cpp.

Referenced by fawkes::NetworkNameResolver::hostname().

◆ short_name()

const char * fawkes::HostInfo::short_name ( )

◆ sys_name()

const char * fawkes::HostInfo::sys_name ( )

Get system name (like Linux).

Returns
system name

Definition at line 144 of file hostinfo.cpp.

◆ sys_release()

const char * fawkes::HostInfo::sys_release ( )

Get system release (kernel version on Linux).

Returns
system release

Definition at line 154 of file hostinfo.cpp.

◆ sys_version()

const char * fawkes::HostInfo::sys_version ( )

Get system version (build date on Linux).

Returns
system version

Definition at line 164 of file hostinfo.cpp.

◆ update()

void fawkes::HostInfo::update ( )

Update information.

Gathers the information again.

Definition at line 73 of file hostinfo.cpp.

Referenced by fawkes::NetworkNameResolver::flush_cache(), and HostInfo().


The documentation for this class was generated from the following files: