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_services Class Reference

#include <services.h>

Inheritance diagram for space_services:
space space_services_slurp

Data Structures

class  record

Public Types

typedef boost::shared_ptr
< space_services
pointer

Public Member Functions

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

Static Public Member Functions

static pointer create (const rcstring &filename)
static bool is_ok_name (const rcstring &name, rcstring &suggest)

Protected Member Functions

 space_services (const rcstring &filename)

Private Member Functions

 space_services ()
 space_services (const space_services &)
space_servicesoperator= (const space_services &)

Private Attributes

int last_num

Detailed Description

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

Definition at line 29 of file services.h.


Member Typedef Documentation

typedef boost::shared_ptr<space_services> space_services::pointer

Reimplemented in space_services_slurp.

Definition at line 33 of file services.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 24 of file services.cc.

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

The constructor. It is private on purpose, use the create class method instead.

Parameters:
filenameThe name of the file to be read.

Definition at line 31 of file services.cc.

The default constructor. Do not use.

The copy constructor. Do not use.


Member Function Documentation

The create class method is used to create new dynaically allocated instance of this class.

Parameters:
filenameThe name of the file to be read.

Definition at line 41 of file services.cc.

The get method is used to get another record from the file. It returns false at end-of-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 the next record, or NULL at and of file

Definition at line 48 of file services.cc.

bool space_services::is_ok_name ( const rcstring name,
rcstring suggest 
) [static]

The is_ok_name method is used to determine if a service name is acceptable. It doesn't strictly follow IANA's rules (http://www.iana.org/assignments/service-names) because IANA itself does not.

Parameters:
nameThe name to be checked
suggestIf the name is not ok, this is a suggested valid alternative
Returns:
true if name is OK, false if not

Definition at line 288 of file services.cc.

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

The assignment operator. Do not use.


Field Documentation

int space_services::last_num [private]

The last_num instance variable is used to remember the previous service number. This is to allow diagnosis of sequencing errors.

Definition at line 171 of file services.h.


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