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

#include <slurp.h>

Inheritance diagram for colon_passwd_slurp:
colon_passwd colon colon_passwd_slurp_check

Public Types

typedef boost::shared_ptr
< colon_passwd_slurp
pointer

Public Member Functions

virtual ~colon_passwd_slurp ()
virtual void read_and_process (void)
record::pointer query_by_name (const rcstring &name) const
record::pointer query_by_uid (const rcstring &uid) const
record::pointer query_by_uid (long uid) const
record::pointer query_by_home (const rcstring &home) const
void walk (colon_passwd_functor &func) const

Static Public Member Functions

static pointer create (const rcstring &filename)

Protected Member Functions

 colon_passwd_slurp (const rcstring &filename)
virtual bool process (const record::pointer &rp)

Private Types

typedef std::map< rcstring,
record::pointer
by_name_t
typedef std::map< rcstring,
record::pointer
by_uid_t
typedef std::map< rcstring,
record::pointer
by_home_t

Private Member Functions

 colon_passwd_slurp ()
 colon_passwd_slurp (const colon_passwd_slurp &)
colon_passwd_slurpoperator= (const colon_passwd_slurp &)

Private Attributes

by_name_t by_name
by_uid_t by_uid
by_home_t by_home

Detailed Description

The colon_passwd_slurp class is used to represent the contents of the passwd file, indexed by name and uid.

Definition at line 31 of file slurp.h.


Member Typedef Documentation

Definition at line 127 of file slurp.h.

Definition at line 111 of file slurp.h.

Definition at line 119 of file slurp.h.

typedef boost::shared_ptr<colon_passwd_slurp> colon_passwd_slurp::pointer

Reimplemented from colon_passwd.

Reimplemented in colon_passwd_slurp_check.

Definition at line 35 of file slurp.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 27 of file slurp.cc.

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

The constructor.

Parameters:
filenameThe name of the file to be read.

Definition at line 32 of file slurp.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 instances of this class.

Parameters:
filenameThe name of the file to be read.

Reimplemented from colon_passwd.

Definition at line 39 of file slurp.cc.

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

The assignment operator. Do not use.

bool colon_passwd_slurp::process ( const record::pointer rp) [protected, virtual]

The process method use used to process each record, verifying against the group information and previous passwd records.

Returns:
true if no errors found, false if there were problems (already reported).

Reimplemented in colon_passwd_slurp_check.

Definition at line 46 of file slurp.cc.

The query_by_home method may be used to look up a user by her home directory, once the read_and_process method has been called.

The query_by_name method may be used to look up users by name, once the read_and_process method has been called.

Definition at line 141 of file slurp.cc.

The query_by_uid method may be used to look up users by uid, once the read_and_process method has been called.

Definition at line 152 of file slurp.cc.

The query_by_uid method may be used to look up users by uid, once the read_and_process method has been called.

Definition at line 163 of file slurp.cc.

void colon_passwd_slurp::read_and_process ( void  ) [virtual]

The read_and_process method is used to read the file and process all of the records.

Definition at line 127 of file slurp.cc.

The walk method is used to visit each entry of the password file. The order is undefined.

Parameters:
funcThe functor to call for each passowrd entry.

Definition at line 171 of file slurp.cc.


Field Documentation

The by_home instance variable is used to index passwd records by the users' home directories. This helps find duplicates.

Definition at line 133 of file slurp.h.

The by_name instance variable is used to index passwd records by name.

Definition at line 117 of file slurp.h.

The by_name instance variable is used to index passwd records by uid.

Definition at line 125 of file slurp.h.


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