KUser Class Reference
Represents a user on your system. More...
#include <kuser.h>
Collaboration diagram for KUser:

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) | |
KUser (const KUser &user) | |
KUser & | operator= (const KUser &user) |
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 |
QValueList< KUserGroup > | groups () const |
QStringList | groupNames () const |
~KUser () | |
Static Public Member Functions | |
static QValueList< KUser > | allUsers () |
static QStringList | allUserNames () |
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 45 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 68 of file kuser.cpp. References uid(), and UseEffectiveUID. Referenced by allUsers(). |
|
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.
Definition at line 86 of file kuser.cpp. References QString::local8Bit(). |
|
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.
|
|
Creates an object from another KUser object.
|
|
Destructor.
|
Member Function Documentation
|
Copies a user.
Definition at line 103 of file kuser.cpp. References d. |
|
Two KUser objects are equal if isValid() is true and the uid() are identical.
Definition at line 109 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 118 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 145 of file kuser.cpp. Referenced by operator==(). |
|
Returns the user id of the user.
Definition at line 149 of file kuser.cpp. Referenced by isSuperUser(), KUser(), and operator==(). |
|
Returns the group id of the user.
Definition at line 156 of file kuser.cpp. Referenced by KUserGroup::KUserGroup(). |
|
Checks whether the user it the super user (root).
Definition at line 163 of file kuser.cpp. References uid(). |
|
The login name of the user.
Definition at line 167 of file kuser.cpp. Referenced by KStandardDirs::addCustomized(). |
|
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.
|
|
Returns all groups of the user.
Definition at line 216 of file kuser.cpp. References KUserGroup::allGroups(), QValueList::append(), QValueList::begin(), QValueList::end(), and QValueList::find(). |
|
Returns all group names of the user.
Definition at line 229 of file kuser.cpp. References KUserGroup::allGroups(), QValueList::begin(), QValueList::end(), and QValueList::find(). |
|
Returns all users of the system.
Definition at line 243 of file kuser.cpp. References QValueList::append(), and KUser(). |
|
Returns all user names of the system.
Definition at line 257 of file kuser.cpp. References QString::fromLocal8Bit(). |
The documentation for this class was generated from the following files: