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

#include <slurp.h>

Inheritance diagram for space_netgroup_slurp:
space_netgroup space

Public Types

typedef boost::shared_ptr
< space_netgroup_slurp
pointer
typedef std::vector< rcstringname_list_t

Public Member Functions

virtual ~space_netgroup_slurp ()
void read_and_process (void)
record::pointer query_by_name (const rcstring &key) const
name_list_t keys_by_name (void) const
name_list_t keys_by_host (void) const
name_list_t query_by_host (const rcstring &key) const
name_list_t keys_by_user (void) const
name_list_t query_by_user (const rcstring &key) const

Static Public Member Functions

static pointer create (const rcstring &filename)
static pointer create (const rcstring &filename, const space_hosts_slurp::pointer &hosts, const colon_passwd_slurp::pointer &passwd)

Private Types

typedef std::map< rcstring,
record::pointer
by_name_t
typedef std::map< rcstring,
name_list_t
by_host_t
typedef std::map< rcstring,
name_list_t
by_user_t

Private Member Functions

 space_netgroup_slurp (const rcstring &filename, const space_hosts_slurp::pointer &hosts, const colon_passwd_slurp::pointer &passwd)
void process (const record::pointer &rp)
 space_netgroup_slurp ()
 space_netgroup_slurp (const space_netgroup_slurp &rhs)
space_netgroup_slurpoperator= (const space_netgroup_slurp &rhs)

Private Attributes

space_hosts_slurp::pointer hosts
colon_passwd_slurp::pointer passwd
by_name_t by_name
by_host_t by_host
by_user_t by_user

Detailed Description

The space_netgroup_slurp class is used to represent the contents of a netgroup file. Use for generating maps or verifying other maps.

Definition at line 32 of file slurp.h.


Member Typedef Documentation

Definition at line 171 of file slurp.h.

Definition at line 163 of file slurp.h.

Definition at line 179 of file slurp.h.

Definition at line 80 of file slurp.h.

Reimplemented from space_netgroup.

Definition at line 36 of file slurp.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 25 of file slurp.cc.

space_netgroup_slurp::space_netgroup_slurp ( const rcstring filename,
const space_hosts_slurp::pointer hosts,
const colon_passwd_slurp::pointer passwd 
) [private]

The constructor. It is private on purpose, use the create class method instead.

Parameters:
filenameThe name of the file to be read.
hostsif non-NULL, use to validate host names
passwdif non-NULL, use to validate user names

Definition at line 30 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 space_netgroup.

Definition at line 52 of file slurp.cc.

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

Parameters:
filenameThe name of the file to be read.
hostsif non-NULL, use to validate host names
passwdif non-NULL, use to validate user names

Definition at line 43 of file slurp.cc.

The keys_by_host method is used to obtain a list of host keys in the by_host database.

Returns:
a list of host names

Definition at line 474 of file slurp.cc.

The keys_by_name method is used to obtain a list of netgroup name keys in the by_name database.

Returns:
a list of netgroup names

Definition at line 447 of file slurp.cc.

The keys_by_user method is used to obtain a list of user keys in the by_user database.

Returns:
a list of user names

Definition at line 501 of file slurp.cc.

space_netgroup_slurp& space_netgroup_slurp::operator= ( const space_netgroup_slurp rhs) [private]

The assignment operator. Do not use.

void space_netgroup_slurp::process ( const record::pointer rp) [private]

The process method is used by the read_and_process method to process reach record.

Definition at line 61 of file slurp.cc.

The query_by_host method is used to fetch a list of names of netgroups which contain the given host. It returns the NULL pointer if the named host is not mentioned in any netgroup.

Parameters:
keythe name of a host
Returns:
list of names of negroups containing that host

Definition at line 490 of file slurp.cc.

The query_by_name method is used to fetch a netgroup entry by name. It returns the NULL pointer if the named netgroup does not exist.

Definition at line 463 of file slurp.cc.

The query_by_user method is used to fetch a list of names of netgroups which contain the given user. It returns the NULL pointer if the named user is not mentioned in any netgroup.

Parameters:
keythe name of the user to look for
Returns:
list of names of netgroups containing that user

Definition at line 517 of file slurp.cc.

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

Definition at line 206 of file slurp.cc.


Field Documentation

The by_host instance variable is the database used to remember the lists of netgroup names indexed by host name.

Definition at line 177 of file slurp.h.

The by_name instance variable is the database used to remember the lists of record indexed by netgroup name.

Definition at line 169 of file slurp.h.

The by_user instance variable is the database used to remember the lists of netgroup names indexed by user name.

Definition at line 185 of file slurp.h.

The hosts instance variable is used to remember the location of the hosts map, used to validate host names. The NULL pointer means don't check.

Definition at line 154 of file slurp.h.

The passwd instance variable is used to remember the location of the passwd map, used to validate user names. The NULL pointer means don't check.

Definition at line 161 of file slurp.h.


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