nis-util  1.0.D108
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
space_hosts Class Reference

#include <hosts.h>

Inheritance diagram for space_hosts:
space space_hosts_slurp

Data Structures

class  record

Public Types

typedef boost::shared_ptr
< space_hosts
pointer

Public Member Functions

virtual ~space_hosts ()
record::pointer get (void)

Static Public Member Functions

static pointer create (const rcstring &filename)
static bool valid_ip_address (const rcstring &input, rcstring &output)
static bool valid_host_name (const rcstring &input, rcstring &output)

Protected Member Functions

 space_hosts (const rcstring &filename)

Private Member Functions

 space_hosts ()
 space_hosts (const space_hosts &)
space_hostsoperator= (const space_hosts &)

Private Attributes

record::pointer last_rp

Detailed Description

The space_hosts class is used to represent the parse state of a hosts file (see hosts(5) for file format information).

Definition at line 30 of file hosts.h.


Member Typedef Documentation

typedef boost::shared_ptr<space_hosts> space_hosts::pointer

Reimplemented in space_hosts_slurp.

Definition at line 34 of file hosts.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 28 of file hosts.cc.

space_hosts::space_hosts ( const rcstring filename) [protected]

The constructor. For use by derived classes only.

Parameters:
filenameThe name of the file to read.

Definition at line 33 of file hosts.cc.

space_hosts::space_hosts ( ) [private]

The default constructor. Do not use.

space_hosts::space_hosts ( const space_hosts ) [private]

The copy constructor. Do not use.


Member Function Documentation

space_hosts::pointer space_hosts::create ( const rcstring filename) [static]

The create class method is used to create new dynamically aloocated instances of this class.

Parameters:
filenameThe name of the file to read.

Reimplemented in space_hosts_slurp.

Definition at line 46 of file hosts.cc.

The get method is used to get another record from the file.

Input lines are validated for simple correctness. Invalid lines cause fatal errors (see the error method) and are not passed through.

Returns:
pointer to a new record, or the NULL pointer at end of file

Definition at line 141 of file hosts.cc.

space_hosts& space_hosts::operator= ( const space_hosts ) [private]

The assignment operator. Do not use.

bool space_hosts::valid_host_name ( const rcstring input,
rcstring output 
) [static]

The valid_host_name method is used to determine if s atring is a valid host name. If it is, `output' is set to the canonical form of the host name.

Definition at line 64 of file hosts.cc.

bool space_hosts::valid_ip_address ( const rcstring input,
rcstring output 
) [static]

The valid_ip_address method is used to determine if s atring is a valid IP address. If it is, `result' is set to the canonical form of the address.

Definition at line 53 of file hosts.cc.


Field Documentation

The last_rp instance variable is used by the get method to check record sequencing.

Definition at line 135 of file hosts.h.


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