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

#include <slurp.h>

Inheritance diagram for colon_group_slurp:
colon_group colon colon_group_slurp_check

Public Types

typedef boost::shared_ptr
< colon_group_slurp
pointer

Public Member Functions

virtual ~colon_group_slurp ()
virtual void read_and_process (void)
record::pointer query_by_name (const rcstring &name) const
record::pointer query_by_gid (const rcstring &gid) const
record::pointer query_by_gid (int gid) const

Static Public Member Functions

static pointer create (const rcstring &filename)

Protected Member Functions

 colon_group_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_gid_t

Private Member Functions

 colon_group_slurp ()
 colon_group_slurp (const colon_group_slurp &)
colon_group_slurpoperator= (const colon_group_slurp &)

Private Attributes

by_name_t by_name
by_name_t by_gid

Detailed Description

The colon_group_slurp class is used to represent the contents of the group file, indexed by name and gid.

Definition at line 29 of file slurp.h.


Member Typedef Documentation

Definition at line 113 of file slurp.h.

Definition at line 105 of file slurp.h.

typedef boost::shared_ptr<colon_group_slurp> colon_group_slurp::pointer

Reimplemented from colon_group.

Reimplemented in colon_group_slurp_check.

Definition at line 33 of file slurp.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 23 of file slurp.cc.

colon_group_slurp::colon_group_slurp ( 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 28 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 instance of this class.

Parameters:
filenameThe name of the file to be read.

Reimplemented from colon_group.

Definition at line 35 of file slurp.cc.

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

The assignment operator. Do not use.

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

The process method is used to process each record as it is read in by the read_and_process method.

Reimplemented in colon_group_slurp_check.

Definition at line 56 of file slurp.cc.

The query_by_gid method is used to look up the group file by gid (after read_and_process has been called).

Parameters:
gidThe group ID to search for
Returns:
pointer to the named group, or NULL if not found

Definition at line 122 of file slurp.cc.

The query_by_gid method is used to look up the group file by gid (after read_and_process has been called).

Parameters:
gidThe group ID to search for
Returns:
pointer to the named group, or NULL if not found

Definition at line 133 of file slurp.cc.

The query_by_name method is used to look up the group file by group name (after read_and_process has been called).

Parameters:
nameThe group name to search for
Returns:
pointer to the named group, or NULL if not found

Definition at line 111 of file slurp.cc.

void colon_group_slurp::read_and_process ( void  ) [virtual]

The read_and_process method is used to read the file and index it into the symbol tables.

Definition at line 42 of file slurp.cc.


Field Documentation

The by_gid instance variable us ised to remember the mapping from group ID to group record.

Definition at line 119 of file slurp.h.

The by_name instance variable us ised to remember the mapping from group name to group record.

Definition at line 111 of file slurp.h.


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