libDwm-0.9.45
Dwm::Password Class Reference

Encapsulates an /etc/passwd entry. More...

#include <DwmPassword.hh>

Public Member Functions

 Password (const std::string &userName)
 Construct from a user name.
 
 Password (uid_t userId)
 Construct from a user ID.
 
void Set (const struct passwd &passwdStruct)
 Use the contents of passwdStruct to fill all of our members.
 
const std::string & UserName () const
 Returns the user name.
 
const std::string & EncryptedPassword () const
 Returns the user password.
 
uid_t UserId () const
 Returns the user ID.
 
gid_t GroupId () const
 Returns the group ID.
 
const std::string & Gecos () const
 Returns the gecos.
 
const std::string & HomeDirectory () const
 Returns the home directory.
 
const std::string & Shell () const
 Returns the shell.
 

Friends

std::ostream & operator<< (std::ostream &os, const Password &password)
 Prints to an ostream in /etc/passwd format.
 

Detailed Description

Encapsulates an /etc/passwd entry.

The main reason for this class: some operating systems don't provide threadsafe versions of getpwuid() and getpwnam().


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