#include <Hostname.h>
Public Member Functions | |
| Hostname () | |
| Hostname constructor, executes the gethostname() system call. | |
| Hostname (std::string name) | |
| Constructor that sets the hostname to the given argument. | |
| Hostname (const Hostname &rhs) | |
| Copy constructor. | |
| Hostname & | operator= (const Hostname &rhs) |
| Assignment operator. | |
| const std::string & | getName () const |
| Get the hostname. | |
| int | status () const |
| Get the return code of the gethostname system call. | |
Private Attributes | |
| std::string | hostname_ |
| The hostname. | |
| int | statusValue_ |
| The return code from gethostname. | |
Friends | |
| std::ostream & | operator<< (std::ostream &output, const Hostname &rhs) |
| Overloaded ostream operator. | |
This class provides an abstraction layer above the posix gethostname() system call so the caller does not have to mess with c-strings since they are ugly!
|
|
Hostname constructor, executes the gethostname() system call.
|
|
|
Constructor that sets the hostname to the given argument.
|
|
|
Get the hostname.
|
|
|
Get the return code of the gethostname system call.
|
1.4.6