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

#include <passwd.h>

Inheritance diagram for colon_passwd:
colon colon_passwd_slurp colon_passwd_slurp_check

Data Structures

class  record

Public Types

typedef boost::shared_ptr
< colon_passwd
pointer

Public Member Functions

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

Static Public Member Functions

static pointer create (const rcstring &filename)
static rcstring is_ok_user_name (const rcstring &text)

Protected Member Functions

 colon_passwd (const rcstring &filename)

Private Member Functions

bool validate (const record::pointer &rp)
 colon_passwd ()
 colon_passwd (const colon_passwd &)
colon_passwdoperator= (const colon_passwd &)

Private Attributes

long last_uid

Detailed Description

The colon_passwd class is used to represent the parse state of a passwd formatted file.

Definition at line 30 of file passwd.h.


Member Typedef Documentation

typedef boost::shared_ptr<colon_passwd> colon_passwd::pointer

Reimplemented in colon_passwd_slurp_check, and colon_passwd_slurp.

Definition at line 34 of file passwd.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 28 of file passwd.cc.

colon_passwd::colon_passwd ( 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 33 of file passwd.cc.

The default constructor. Do not use.

colon_passwd::colon_passwd ( const colon_passwd ) [private]

The copy constructor. Do not use.


Member Function Documentation

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

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

Parameters:
filenameThe name of the file to be read.

Reimplemented in colon_passwd_slurp.

Definition at line 49 of file passwd.cc.

The get method is used to get another passwd entry 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:
returns a new record, or NULL at end of file.

Definition at line 56 of file passwd.cc.

rcstring colon_passwd::is_ok_user_name ( const rcstring text) [static]

The is_ok_user_name method is used to scan a user name and replace any invalid characters with valid ones. (The name is misleading, to test for validity, compare the input with the output.)

Definition at line 400 of file passwd.cc.

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

The assignment operator. Do not use.

bool colon_passwd::validate ( const record::pointer rp) [private]

The validate method is used to check that passwd entries are valid, within themselves. (Validation between fields, or between files, is not done.) Returns true for valid lines, and false otherwise.

Definition at line 114 of file passwd.cc.


Field Documentation

long colon_passwd::last_uid [private]

The last_uid instance variable tracks the uid within the file, for sequence error reporting. This is tracked because it catches most uid typographical errors.

Definition at line 187 of file passwd.h.


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