NAME

OUX_Group - Class to encapsulate UNIX group information.

SYNOPSIS


#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;
};

CLASS TYPE

Concrete

DESCRIPTION

The OUX_Group class is a wrapper around the group entry structure.

INITIALISATION

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);

ENQUIRY

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;

NOTES

If the data used to get information about the group, doesn't identify a valid group on the host then the information will be filled out with default values. The 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.

LIBRARY

OUX

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1991 1992 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED