KUser Class Reference
Represents a user on your system. More...
#include <kuser.h>
Public Types | |
enum | UIDMode { UseEffectiveUID, UseRealUserID } |
Public Member Functions | |
KUser (UIDMode mode=UseEffectiveUID) | |
KUser (long uid) | |
KUser (const QString &name) | |
KUser (const char *name) | |
KUser (struct passwd *p) | |
bool | operator== (const KUser &user) const |
bool | operator!= (const KUser &user) const |
bool | isValid () const |
long | uid () const |
long | gid () const |
bool | isSuperUser () const |
QString | loginName () const |
QString | fullName () const |
QString | roomNumber () const |
QString | workPhone () const |
QString | homePhone () const |
QString | homeDir () const |
QString | shell () const |
~KUser () |
Detailed Description
Represents a user on your system.This class represents a user on your system. You can either get information about the current user, of fetch information about a user on the system. Instances of this class will be explicitly shared, so copying objects is very cheap and you can safely pass objects by value.
- Author:
- Tim Jansen <tim@tjansen.de>
- Since:
- 3.2
Definition at line 44 of file kuser.h.
Member Enumeration Documentation
|
|
Constructor & Destructor Documentation
|
Creates an object that contains information about the current user. (as returned by getuid(2) or geteuid(2), taking $LOGNAME/$USER into account).
Definition at line 66 of file kuser.cpp. References uid(), and UseEffectiveUID. |
|
Creates an object for the user with the given user id. If the user does not exist isValid() will return false.
|
|
Creates an object that contains information about the user with the given name. If the user does not exist isValid() will return false.
|
|
Creates an object that contains information about the user with the given name. If the user does not exist isValid() will return false.
|
|
Creates an object from a passwd structure. If the pointer is null isValid() will return false.
|
|
Destructor.
|
Member Function Documentation
|
Two KUser objects are equal if isValid() is true and the uid() are identical.
Definition at line 92 of file kuser.cpp. References isValid(), and uid(). Referenced by operator!=(). |
|
Two KUser objects are not equal if either isValid() is not true or uid() are not identical.
Definition at line 101 of file kuser.cpp. References operator==(). |
|
Returns true if the user is valid. A KUser object can be invalid if you created it with an non-existing uid or name.
Definition at line 128 of file kuser.cpp. Referenced by operator==(). |
|
Returns the user id of the user.
Definition at line 132 of file kuser.cpp. Referenced by isSuperUser(), KUser(), and operator==(). |
|
Returns the group id of the user.
|
|
Checks whether the user it the super user (root).
Definition at line 146 of file kuser.cpp. References uid(). |
|
The login name of the user.
|
|
The full name of the user.
|
|
The user's room number.
|
|
The user's work phone.
|
|
The user's home phone.
|
|
The path to the user's home directory.
|
|
The path to the user's login shell.
|
The documentation for this class was generated from the following files: