KCoreAddons
14 #include <kcoreaddons_export.h>
16 #include <QSharedDataPointer>
17 #include <QStringList>
19 #include <qcontainerfwd.h>
27 struct WindowsSIDWrapper;
29 #include <sys/types.h>
40 #define KCOREADDONS_UINT_MAX (std::numeric_limits<uint>::max)()
86 NativeType nativeId()
const;
155 static KUserId currentUserId();
160 static KUserId currentEffectiveUserId();
195 static KGroupId currentEffectiveGroupId();
201 return qHash(
id.nativeId(), seed);
205 return qHash(
id.nativeId(), seed);
209 KCOREADDONS_EXPORT uint
qHash(
const KUserId &
id, uint seed = 0);
210 KCOREADDONS_EXPORT uint
qHash(
const KGroupId &
id, uint seed = 0);
246 explicit KUser(UIDMode mode = UseEffectiveUID);
253 explicit KUser(K_UID uid);
276 explicit KUser(
const char *name);
285 explicit KUser(
const passwd *p);
305 bool operator==(
const KUser &user)
const;
311 bool operator!=(
const KUser &user)
const;
318 bool isValid()
const;
326 #if KCOREADDONS_ENABLE_DEPRECATED_SINCE(5, 0)
332 KCOREADDONS_DEPRECATED_VERSION(5, 0,
"Use KUser::groupId()")
335 return groupId().nativeId();
343 bool isSuperUser()
const;
351 #if KCOREADDONS_ENABLE_DEPRECATED_SINCE(5, 0)
357 KCOREADDONS_DEPRECATED_VERSION(5, 0,
"Use KUser::property(KUser::FullName).toString()")
360 return property(FullName).toString();
367 KCOREADDONS_DEPRECATED_VERSION(5, 0,
"Use KUser::userId().nativeId()")
370 return userId().nativeId();
405 QStringList groupNames(uint maxCount = KCOREADDONS_UINT_MAX)
const;
422 QVariant property(UserProperty which)
const;
433 static QList<KUser> allUsers(uint maxCount = KCOREADDONS_UINT_MAX);
439 static QStringList allUserNames(uint maxCount = KCOREADDONS_UINT_MAX);
527 bool operator==(
const KUserGroup &group)
const;
534 bool operator!=(
const KUserGroup &group)
const;
542 bool isValid()
const;
544 #if KCOREADDONS_ENABLE_DEPRECATED_SINCE(5, 0)
550 KCOREADDONS_DEPRECATED_VERSION(5, 0,
"Use KUserGroup::groupId().nativeId()")
553 return groupId().nativeId();
570 QList<KUser> users(uint maxCount = KCOREADDONS_UINT_MAX)
const;
576 QStringList userNames(uint maxCount = KCOREADDONS_UINT_MAX)
const;
593 static QStringList allGroupNames(uint maxCount = KCOREADDONS_UINT_MAX);
599 #if !defined(Q_OS_WIN)
604 return id != NativeType(-1);
609 return id == other.id;
614 return id != other.id;
651 #endif // !defined(Q_OS_WIN)
KGroupId()
Creates an invalid KGroupId.
QString number(int n, int base)
KUserId()
Creates an invalid KUserId.
A platform independent user or group ID.
NativeType nativeId() const
@ UseEffectiveUID
Use the effective user id.
bool operator!=(const KUserGroup &group) const
Two KUserGroup objects are not equal if their gid()s are not identical.
bool operator!=(const KUserOrGroupId &other) const
A platform independent user ID.
Represents a group on your system.
KUserOrGroupId()
Creates an invalid KUserOrGroupId.
KCALENDARCORE_EXPORT uint qHash(const KCalendarCore::Period &key)
A platform independent group ID.
Represents a user on your system.
bool operator==(const KUserGroup &group) const
Two KUserGroup objects are equal if their gid()s are identical.
bool operator!=(const KUser &user) const
Two KUser objects are not equal if userId() are not identical.
KGroupId(K_GID gid)
Creates an KGroupId from the native group ID type.
bool operator==(const KUser &user) const
Two KUser objects are equal if the userId() are identical.
bool operator==(const KUserOrGroupId &other) const
@ UseRealUserID
Use the real user id.
KUserId(K_UID uid)
Creates an KUserId from the native user ID type.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 04:04:52 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.