NAME

OUX_User - Class to encapsulate UNIX user information.

SYNOPSIS


#include <OUX/system/user.hh>

class OUX_User
{
  public:
    static os_typespec* get_os_typespec();
    OUX_User();
    OUX_User(uid_t theUID);
    OUX_User(OTC_String const& theName);
    OUX_User(passwd const* thePwent);
    OUX_User(OUX_User const& theUser);
    OUX_User& operator=(OUX_User const& theUser);
    OUX_User& operator=(passwd const* thePwent);
    inline OTC_Boolean isValid() const;
    inline OTC_String const& name() const;
    inline OTC_String const& fullname() const;
    inline uid_t uid() const;
    inline operator uid_t() const;
    inline gid_t gid() const;
};

CLASS TYPE

Concrete

DESCRIPTION

The OUX_User class is a wrapper around the password entry for a user.

INITIALISATION

OUX_User();
OUX_User(uid_t theUID);
OUX_User(OTC_String const& theName);
OUX_User(passwd const* thePwent);
OUX_User(OUX_User const& theUser);
OUX_User& operator=(OUX_User const& theUser);
OUX_User& operator=(passwd const* thePwent);

ENQUIRY

inline OTC_Boolean isValid() const;
inline OTC_String const& name() const;
inline OTC_String const& fullname() const;
inline uid_t uid() const;
inline operator uid_t() const;
inline gid_t gid() const;

NOTES

If the data used to get information about the user, doesn't identify a valid user 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 getpwent() to get all entries in the passwd file may not be able to be used while creating instances of this class using any constructor besides the copy constructor and that accepting a pointer to a passwd structure, as instantiation of the class may have the result of reseting the pointer used by getpwent() back to the start. Whether this occurs will depend on your variant of UNIX. An OTC_BaseActions and OTC_HashActions are defined for OUX_User. For OTC_HashActions the key on which hashing and comparison is based is the user id.

LIBRARY

OUX

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

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