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

#include <protocols.h>

Inheritance diagram for space_protocols:
space space_protocols_slurp

Data Structures

class  record

Public Types

typedef boost::shared_ptr
< space_protocols
pointer

Public Member Functions

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

Static Public Member Functions

static pointer create (const rcstring &filename)
static bool is_ok_name (const rcstring &text, bool upper_case_ok, rcstring &suggestion)

Protected Member Functions

 space_protocols (const rcstring &filename)

Private Member Functions

 space_protocols ()
 space_protocols (const space_protocols &)
space_protocolsoperator= (const space_protocols &)

Private Attributes

int last_num

Detailed Description

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

Definition at line 31 of file protocols.h.


Member Typedef Documentation

typedef boost::shared_ptr<space_protocols> space_protocols::pointer

Reimplemented in space_protocols_slurp.

Definition at line 35 of file protocols.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 23 of file protocols.cc.

space_protocols::space_protocols ( 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 30 of file protocols.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 dynamically allocated instance of this class.

Parameters:
filenameThe name of the file to be read.

Reimplemented in space_protocols_slurp.

Definition at line 40 of file protocols.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 new record, or a NULL pointer at end of file

Definition at line 47 of file protocols.cc.

bool space_protocols::is_ok_name ( const rcstring text,
bool  upper_case_ok,
rcstring suggestion 
) [static]

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

Parameters:
textthe text of a name candidate.
upper_case_oktrue if upper case is acceptable (aliases), or false is lower case is required (primary key).
suggestionthe suggested text of a valid name, if different than the input text
Returns:
true if name is OK, false if not.

Definition at line 242 of file protocols.cc.

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

The assignment operator. Do not use.


Field Documentation

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

Definition at line 199 of file protocols.h.


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