nis-util
1.0.D108
|
#include <protocols.h>
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_protocols & | operator= (const space_protocols &) |
Private Attributes | |
int | last_num |
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.
typedef boost::shared_ptr<space_protocols> space_protocols::pointer |
Reimplemented in space_protocols_slurp.
Definition at line 35 of file protocols.h.
space_protocols::~space_protocols | ( | ) | [virtual] |
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.
filename | The name of the file to be read. |
Definition at line 30 of file protocols.cc.
space_protocols::space_protocols | ( | ) | [private] |
The default constructor. Do not use.
space_protocols::space_protocols | ( | const space_protocols & | ) | [private] |
The copy constructor. Do not use.
space_protocols::pointer space_protocols::create | ( | const rcstring & | filename | ) | [static] |
The create class method is used to create new dynamically allocated instance of this class.
filename | The 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.
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.
text | the text of a name candidate. |
upper_case_ok | true if upper case is acceptable (aliases), or false is lower case is required (primary key). |
suggestion | the suggested text of a valid name, if different than the input text |
Definition at line 242 of file protocols.cc.
space_protocols& space_protocols::operator= | ( | const space_protocols & | ) | [private] |
The assignment operator. Do not use.
int space_protocols::last_num [private] |
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.