#include <OUX/system/group.hh> class OUX_Group {
public:
static os_typespec* get_os_typespec();
OUX_Group();
OUX_Group(gid_t theGID);
OUX_Group(OTC_String const& theName);
OUX_Group(group const* theGrent);
OUX_Group(OUX_Group const& theGroup);
OUX_Group& operator=(OUX_Group const& theGroup);
OUX_Group& operator=(group const* theGrent);
inline OTC_Boolean isValid() const;
inline OTC_String const& name() const;
inline gid_t gid() const;
inline operator gid_t() const;
inline OTC_Boolean isMember(OTC_String const& theName) const;
inline OTC_Iterator<OTC_String> members() const;
};
OUX_Group
class is a wrapper around the group entry
structure.
OUX_Group();
OUX_Group(gid_t theGID);
theGID
. If theGID
doesn't describe
a valid group on this host then the group
id will still be used, and group name will
be set to the group id. The set of
members for the group will be empty.
OUX_Group(OTC_String const& theName);
theName
. If theName
doesn't
describe a valid group on this host then
the group name will still be used, however
the group id will be set to MAXUID
,
the id generally associated with the user
nobody
. The set of members for the group
will be empty.
OUX_Group(group const* theGrent);
theGrent
. If theGrent
is 0
then the
group id and group name are set to
MAXUID
, the id generally associated with
the user nobody
. The set of members for
the group will be empty.
OUX_Group(OUX_Group const& theGroup);
theGroup
.
OUX_Group& operator=(OUX_Group const& theGroup);
theGroup
.
OUX_Group& operator=(group const* theGrent);
theGrent
. If theGrent
is 0
then the
group id and group name are set to
MAXUID
, the id generally associated with
the user nobody
. The set of members for
the group will be empty.
inline OTC_Boolean isValid() const;
OTCLIB_TRUE
if this class
describes a valid group on this host.
inline OTC_String const& name() const;
inline gid_t gid() const;
inline operator gid_t() const;
inline OTC_Boolean isMember(OTC_String const& theName) const;
OTCLIB_TRUE
if theName
is a
member of this group.
inline OTC_Iterator<OTC_String> members() const;
isValid()
function should
always be invoked to actually determine if the information
gathered is correct.
Note that successive calls to getgrent()
to get all entries in
the group file may not be able to be used while creating instances
of this class using any constructor other than that taking a
pointer to the group structure, or the copy constructor, as
instantiation of this class may have the result of reseting the
pointer used by getgrent()
back to the start. Whether this
occurs will depend on your variant of UNIX.
An OTC_BaseActions
and OTC_HashActions
are defined for
OUX_Group
. For OTC_HashActions
the key on which hashing
and comparison is performed is the group id.