Hostname Class Reference

Simple class wrapper around the gethostname() system call. More...

#include <Hostname.h>

List of all members.

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.
Hostnameoperator= (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.


Detailed Description

Simple class wrapper around the gethostname() system call.

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!


Constructor & Destructor Documentation

Hostname::Hostname  ) 
 

Hostname constructor, executes the gethostname() system call.

Exceptions:
FountainException if there was an error calling gethostname()

Hostname::Hostname std::string  name  ) 
 

Constructor that sets the hostname to the given argument.

Parameters:
name The hostname to use


Member Function Documentation

const std::string& Hostname::getName  )  const [inline]
 

Get the hostname.

Returns:
a const references string containing the hostname

int Hostname::status  )  const [inline]
 

Get the return code of the gethostname system call.

Returns:
the status of the gethostname() system call from the constructor


The documentation for this class was generated from the following files:
Generated on Wed Mar 8 14:43:33 2006 for Fountain by  doxygen 1.4.6