Rudiments
passwdentry.h
1 // Copyright (c) 2002 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_PASSWDENTRY_H
5 #define RUDIMENTS_PASSWDENTRY_H
6 
7 #include <rudiments/private/passwdentryincludes.h>
8 
9 class passwdentryprivate;
10 
13 class RUDIMENTS_DLLSPEC passwdentry {
14  public:
15 
17  passwdentry();
18 
21  passwdentry(const passwdentry &p);
22 
25  passwdentry &operator=(const passwdentry &p);
26 
28  ~passwdentry();
29 
32  bool initialize(const char *username);
33 
36  bool initialize(uid_t userid);
37 
39  const char *getName() const;
40 
42  const char *getPassword() const;
43 
54  uid_t getUserId() const;
55 
63  const char *getSid() const;
64 
66  gid_t getPrimaryGroupId() const;
67 
69  const char *getRealName() const;
70 
72  const char *getHomeDirectory() const;
73 
75  const char *getShell() const;
76 
85  static char *getName(uid_t userid);
86 
93  static uid_t getUserId(const char *username);
94 
104  static char *getSid(const char *username);
105 
111  static bool platformSupportsFormalSid();
112 
115  static bool needsMutex();
116 
120  static void setMutex(threadmutex *mtx);
121 
122  #include <rudiments/private/passwdentry.h>
123 };
124 
125 #endif