Rudiments
groupentry.h
1 // Copyright (c) 2002 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_GROUPENTRY_H
5 #define RUDIMENTS_GROUPENTRY_H
6 
7 #include <rudiments/private/groupentryincludes.h>
8 
9 #ifdef RUDIMENTS_NAMESPACE
10 namespace rudiments {
11 #endif
12 
13 class groupentryprivate;
14 
17 class RUDIMENTS_DLLSPEC groupentry {
18  public:
19 
25  static bool getPassword(const char *groupname,
26  char **password);
27 
31  static bool getGroupId(const char *groupname,
32  gid_t *groupid);
33 
40  static bool getMembers(const char *groupname,
41  char ***members);
42 
48  static bool getName(gid_t groupid, char **name);
49 
55  static bool getPassword(gid_t groupid, char **password);
56 
63  static bool getMembers(gid_t groupid, char ***members);
64 
65 
67  groupentry();
68 
71  groupentry(const groupentry &g);
72 
75  groupentry &operator=(const groupentry &g);
76 
78  ~groupentry();
79 
82  bool initialize(const char *groupname);
83 
86  bool initialize(gid_t groupid);
87 
89  const char *getName() const;
90 
92  const char *getPassword() const;
93 
95  gid_t getGroupId() const;
96 
99  const char * const *getMembers() const;
100 
101 
103  void print() const;
104 
107  static bool needsMutex();
108 
112  static void setMutex(mutex *mtx);
113 
114  #include <rudiments/private/groupentry.h>
115 };
116 
117 #ifdef RUDIMENTS_NAMESPACE
118 }
119 #endif
120 
121 #endif