#include <user.h>
Public Member Functions | |
User () | |
Initialize to current user, equivalent with User(getuid()). | |
User (uid_t uid) throw (UserError) | |
Initialize to user with given uid, throw UserError if not found. | |
User (const std::string &name) throw (UserError) | |
Initialize to user with given user name, throw UserError if not found. | |
uid_t | uid () const |
Retrieve uid of this user. | |
gid_t | gid () const |
Retrieve current group id of this user. | |
const std::string & | home () const |
Retrieve pathname of home directory of this user. | |
const std::string & | shell () const |
Retrieve pathname of shell program of this user. | |
const std::string & | name () const |
Retrieve user name of this user. | |
const std::string & | full_name () const |
Retrieve full name (gecos field) of this user. | |
bool | password (const std::string &pass) const |
Return true iff called by root and password matches user's password. | |
bool | operator== (const User &u) const |
Users are equal if they have the same uid. | |
bool | operator< (const User &u) const |
Based on the comparison of the uid's. | |
bool | operator> (const User &u) const |
bool | operator!= (const User &u) const |
bool | operator>= (const User &u) const |
bool | operator<= (const User &u) const |
Private Member Functions | |
void * | getpwinfo (void *) |
Private Attributes | |
std::string | name_ |
std::string | full_name_ |
uid_t | uid_ |
gid_t | gid_ |
std::string | home_ |
std::string | shell_ |
This class provides a convenient wrapper around information that is usually obtained using getpwnam().
Definition at line 29 of file user.h.
|
Initialize to current user, equivalent with User(getuid()).
|
|
Initialize to user with given uid, throw UserError if not found.
|
|
Initialize to user with given user name, throw UserError if not found.
|
|
Retrieve uid of this user. Definition at line 39 of file user.h. References uid_. Referenced by operator<(), and operator==(). |
|
Retrieve current group id of this user. Definition at line 41 of file user.h. References gid_. |
|
Retrieve pathname of home directory of this user. Definition at line 43 of file user.h. References home_. |
|
Retrieve pathname of shell program of this user. Definition at line 45 of file user.h. References shell_. |
|
Retrieve user name of this user. Definition at line 47 of file user.h. References name_. |
|
Retrieve full name (gecos field) of this user. Definition at line 49 of file user.h. References full_name_. |
|
Return true iff called by root and password matches user's password.
|
|
Users are equal if they have the same uid. Definition at line 54 of file user.h. References uid(). |
|
Based on the comparison of the uid's. Definition at line 56 of file user.h. References uid(). |
|
|
|
|
|
|
|
Definition at line 66 of file user.h. Referenced by name(). |
|
Definition at line 67 of file user.h. Referenced by full_name(). |
|
Definition at line 68 of file user.h. Referenced by uid(). |
|
Definition at line 69 of file user.h. Referenced by gid(). |
|
Definition at line 70 of file user.h. Referenced by home(). |
|
Definition at line 71 of file user.h. Referenced by shell(). |
dvutil-0.13.15 | [30 December, 2004] |