\section{KUser$<$ T $>$ Class Template Reference}
\label{classKUser}\index{KUser@{KUser}}
Represents a user on your system.  


{\tt \#include $<$kuser.h$>$}

Collaboration diagram for KUser$<$ T $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=92pt]{classKUser__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf UIDMode} \{ {\bf Use\-Effective\-UID}, 
{\bf Use\-Real\-User\-ID}
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KUser} ({\bf UIDMode} mode=Use\-Effective\-UID)
\item 
{\bf KUser} (long uid)
\item 
{\bf KUser} (const {\bf QString} \&name)
\item 
{\bf KUser} (const char $\ast$name)
\item 
{\bf KUser} (struct passwd $\ast$p)
\item 
{\bf KUser} (const {\bf KUser} \&user)
\item 
{\bf KUser} \& {\bf operator=} (const {\bf KUser} \&user)
\item 
bool {\bf operator==} (const {\bf KUser} \&user) const 
\item 
bool {\bf operator!=} (const {\bf KUser} \&user) const 
\item 
bool {\bf is\-Valid} () const 
\item 
long {\bf uid} () const 
\item 
long {\bf gid} () const 
\item 
bool {\bf is\-Super\-User} () const 
\item 
{\bf QString} {\bf login\-Name} () const 
\item 
{\bf QString} {\bf full\-Name} () const 
\item 
{\bf QString} {\bf room\-Number} () const 
\item 
{\bf QString} {\bf work\-Phone} () const 
\item 
{\bf QString} {\bf home\-Phone} () const 
\item 
{\bf QString} {\bf home\-Dir} () const 
\item 
{\bf QString} {\bf shell} () const 
\item 
{\bf QValue\-List}$<$ {\bf KUser\-Group} $>$ {\bf groups} () const 
\item 
{\bf QString\-List} {\bf group\-Names} () const 
\item 
{\bf $\sim$KUser} ()
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf QValue\-List}$<$ {\bf KUser} $>$ {\bf all\-Users} ()
\item 
static {\bf QString\-List} {\bf all\-User\-Names} ()
\end{CompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class T$>$ class KUser$<$ T $>$}

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.

\begin{Desc}
\item[Author:]Tim Jansen $<${\tt tim@tjansen.de}$>$ \end{Desc}
\begin{Desc}
\item[Since:]3.2 \end{Desc}




Definition at line 45 of file kuser.h.

\subsection{Member Enumeration Documentation}
\index{KUser@{KUser}!UIDMode@{UIDMode}}
\index{UIDMode@{UIDMode}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ enum {\bf KUser::UIDMode}}\label{classKUser_w2}


\begin{Desc}
\item[Enumeration values: ]\par
\begin{description}
\index{UseEffectiveUID@{UseEffectiveUID}!KUser@{KUser}}\index{KUser@{KUser}!UseEffectiveUID@{UseEffectiveUID}}\item[{\em 
Use\-Effective\-UID\label{classKUser_w2w0}
}]Use the effective user id. \index{UseRealUserID@{UseRealUserID}!KUser@{KUser}}\index{KUser@{KUser}!UseRealUserID@{UseRealUserID}}\item[{\em 
Use\-Real\-User\-ID\label{classKUser_w2w1}
}]Use the real user id. \end{description}
\end{Desc}



Definition at line 49 of file kuser.h.

\subsection{Constructor \& Destructor Documentation}
\index{KUser@{KUser}!KUser@{KUser}}
\index{KUser@{KUser}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf KUser}$<$ T $>$::{\bf KUser} ({\bf UIDMode} {\em mode} = {\tt UseEffectiveUID})}\label{classKUser_a0}


Creates an object that contains information about the current user. 

(as returned by getuid(2) or geteuid(2), taking \$LOGNAME/\$USER into account). \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mode}]if {\bf Use\-Effective\-UID}{\rm (p.\,\pageref{classKUser_w2w0})} is passed the effective user is returned. If {\bf Use\-Real\-User\-ID}{\rm (p.\,\pageref{classKUser_w2w1})} is passed the real user will be returned. The real UID will be different than the effective UID in setuid programs; in such a case use the effective UID for checking permissions, and the real UID for displaying information about the user. \end{description}
\end{Desc}


Definition at line 68 of file kuser.cpp.

References KUser$<$ T $>$::uid(), and KUser$<$ T $>$::Use\-Effective\-UID.

Referenced by KUser$<$ T $>$::all\-Users().\index{KUser@{KUser}!KUser@{KUser}}
\index{KUser@{KUser}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf KUser}$<$ T $>$::{\bf KUser} (long {\em uid})}\label{classKUser_a1}


Creates an object for the user with the given user id. 

If the user does not exist {\bf is\-Valid()}{\rm (p.\,\pageref{classKUser_a9})} will return false. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em uid}]the user id \end{description}
\end{Desc}


Definition at line 82 of file kuser.cpp.\index{KUser@{KUser}!KUser@{KUser}}
\index{KUser@{KUser}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf KUser}$<$ T $>$::{\bf KUser} (const {\bf QString} \& {\em name})}\label{classKUser_a2}


Creates an object that contains information about the user with the given name. 

If the user does not exist {\bf is\-Valid()}{\rm (p.\,\pageref{classKUser_a9})} will return false.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]the name of the user \end{description}
\end{Desc}


Definition at line 86 of file kuser.cpp.\index{KUser@{KUser}!KUser@{KUser}}
\index{KUser@{KUser}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf KUser}$<$ T $>$::{\bf KUser} (const char $\ast$ {\em name})}\label{classKUser_a3}


Creates an object that contains information about the user with the given name. 

If the user does not exist {\bf is\-Valid()}{\rm (p.\,\pageref{classKUser_a9})} will return false.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]the name of the user \end{description}
\end{Desc}


Definition at line 90 of file kuser.cpp.\index{KUser@{KUser}!KUser@{KUser}}
\index{KUser@{KUser}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf KUser}$<$ T $>$::{\bf KUser} (struct passwd $\ast$ {\em p})}\label{classKUser_a4}


Creates an object from a passwd structure. 

If the pointer is null {\bf is\-Valid()}{\rm (p.\,\pageref{classKUser_a9})} will return false.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em p}]the passwd structure to create the user from \end{description}
\end{Desc}


Definition at line 94 of file kuser.cpp.\index{KUser@{KUser}!KUser@{KUser}}
\index{KUser@{KUser}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf KUser}$<$ T $>$::{\bf KUser} (const {\bf KUser}$<$ T $>$ \& {\em user})}\label{classKUser_a5}


Creates an object from another KUser object. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em user}]the user to create the new object from \end{description}
\end{Desc}


Definition at line 98 of file kuser.cpp.\index{KUser@{KUser}!~KUser@{$\sim$KUser}}
\index{~KUser@{$\sim$KUser}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf KUser}$<$ T $>$::$\sim${\bf KUser} ()}\label{classKUser_a22}


Destructor. 



Definition at line 271 of file kuser.cpp.

\subsection{Member Function Documentation}
\index{KUser@{KUser}!operator=@{operator=}}
\index{operator=@{operator=}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf KUser} \& {\bf KUser}$<$ T $>$::operator= (const {\bf KUser}$<$ T $>$ \& {\em user})}\label{classKUser_a6}


Copies a user. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em user}]the user to copy \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]this object \end{Desc}


Definition at line 103 of file kuser.cpp.\index{KUser@{KUser}!operator==@{operator==}}
\index{operator==@{operator==}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ bool {\bf KUser}$<$ T $>$::operator== (const {\bf KUser}$<$ T $>$ \& {\em user}) const}\label{classKUser_a7}


Two KUser objects are equal if {\bf is\-Valid()}{\rm (p.\,\pageref{classKUser_a9})} is true and the {\bf uid()}{\rm (p.\,\pageref{classKUser_a10})} are identical. 



Definition at line 109 of file kuser.cpp.

References KUser$<$ T $>$::is\-Valid(), and KUser$<$ T $>$::uid().

Referenced by KUser$<$ T $>$::operator!=().\index{KUser@{KUser}!operator"!=@{operator"!=}}
\index{operator"!=@{operator"!=}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ bool {\bf KUser}$<$ T $>$::operator!= (const {\bf KUser}$<$ T $>$ \& {\em user}) const}\label{classKUser_a8}


Two KUser objects are not equal if either {\bf is\-Valid()}{\rm (p.\,\pageref{classKUser_a9})} is not true or {\bf uid()}{\rm (p.\,\pageref{classKUser_a10})} are not identical. 



Definition at line 118 of file kuser.cpp.

References KUser$<$ T $>$::operator==().\index{KUser@{KUser}!isValid@{isValid}}
\index{isValid@{isValid}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ bool {\bf KUser}$<$ T $>$::is\-Valid () const}\label{classKUser_a9}


Returns true if the user is valid. 

A KUser object can be invalid if you created it with an non-existing uid or name. \begin{Desc}
\item[Returns:]true if the user is valid \end{Desc}


Definition at line 145 of file kuser.cpp.

Referenced by KUser$<$ T $>$::operator==().\index{KUser@{KUser}!uid@{uid}}
\index{uid@{uid}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ long {\bf KUser}$<$ T $>$::uid () const}\label{classKUser_a10}


Returns the user id of the user. 

\begin{Desc}
\item[Returns:]the id of the user or -1 if user is invalid \end{Desc}


Definition at line 149 of file kuser.cpp.

Referenced by KUser$<$ T $>$::is\-Super\-User(), KUser$<$ T $>$::KUser(), and KUser$<$ T $>$::operator==().\index{KUser@{KUser}!gid@{gid}}
\index{gid@{gid}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ long {\bf KUser}$<$ T $>$::gid () const}\label{classKUser_a11}


Returns the group id of the user. 

\begin{Desc}
\item[Returns:]the id of the group or -1 if user is invalid \end{Desc}


Definition at line 156 of file kuser.cpp.

Referenced by KUser\-Group::KUser\-Group().\index{KUser@{KUser}!isSuperUser@{isSuperUser}}
\index{isSuperUser@{isSuperUser}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ bool {\bf KUser}$<$ T $>$::is\-Super\-User () const}\label{classKUser_a12}


Checks whether the user it the super user (root). 

\begin{Desc}
\item[Returns:]true if the user is root \end{Desc}


Definition at line 163 of file kuser.cpp.

References KUser$<$ T $>$::uid().\index{KUser@{KUser}!loginName@{loginName}}
\index{loginName@{loginName}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf QString} {\bf KUser}$<$ T $>$::login\-Name () const}\label{classKUser_a13}


The login name of the user. 

\begin{Desc}
\item[Returns:]the login name of the user or QString::null if user is invalid \end{Desc}


Definition at line 167 of file kuser.cpp.

Referenced by KStandard\-Dirs::add\-Customized().\index{KUser@{KUser}!fullName@{fullName}}
\index{fullName@{fullName}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf QString} {\bf KUser}$<$ T $>$::full\-Name () const}\label{classKUser_a14}


The full name of the user. 

\begin{Desc}
\item[Returns:]the full name of the user or QString::null if user is invalid \end{Desc}


Definition at line 174 of file kuser.cpp.\index{KUser@{KUser}!roomNumber@{roomNumber}}
\index{roomNumber@{roomNumber}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf QString} {\bf KUser}$<$ T $>$::room\-Number () const}\label{classKUser_a15}


The user's room number. 

\begin{Desc}
\item[Returns:]the room number of the user or QString::null if not set or the user is invalid \end{Desc}


Definition at line 181 of file kuser.cpp.\index{KUser@{KUser}!workPhone@{workPhone}}
\index{workPhone@{workPhone}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf QString} {\bf KUser}$<$ T $>$::work\-Phone () const}\label{classKUser_a16}


The user's work phone. 

\begin{Desc}
\item[Returns:]the work phone of the user or QString::null if not set or the user is invalid \end{Desc}


Definition at line 188 of file kuser.cpp.\index{KUser@{KUser}!homePhone@{homePhone}}
\index{homePhone@{homePhone}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf QString} {\bf KUser}$<$ T $>$::home\-Phone () const}\label{classKUser_a17}


The user's home phone. 

\begin{Desc}
\item[Returns:]the home phone of the user or QString::null if not set or the user is invalid \end{Desc}


Definition at line 195 of file kuser.cpp.\index{KUser@{KUser}!homeDir@{homeDir}}
\index{homeDir@{homeDir}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf QString} {\bf KUser}$<$ T $>$::home\-Dir () const}\label{classKUser_a18}


The path to the user's home directory. 

\begin{Desc}
\item[Returns:]the home directory of the user or QString::null if the user is invalid \end{Desc}


Definition at line 202 of file kuser.cpp.\index{KUser@{KUser}!shell@{shell}}
\index{shell@{shell}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf QString} {\bf KUser}$<$ T $>$::shell () const}\label{classKUser_a19}


The path to the user's login shell. 

\begin{Desc}
\item[Returns:]the login shell of the user or QString::null if the user is invalid \end{Desc}


Definition at line 209 of file kuser.cpp.\index{KUser@{KUser}!groups@{groups}}
\index{groups@{groups}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf QValue\-List}$<$ {\bf KUser\-Group} $>$ {\bf KUser}$<$ T $>$::groups () const}\label{classKUser_a20}


Returns all groups of the user. 

\begin{Desc}
\item[Returns:]all groups of the user \end{Desc}


Definition at line 216 of file kuser.cpp.

References KUser\-Group::all\-Groups(), QValue\-List::append(), QValue\-List::begin(), QValue\-List::end(), and QValue\-List::find().\index{KUser@{KUser}!groupNames@{groupNames}}
\index{groupNames@{groupNames}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf QString\-List} {\bf KUser}$<$ T $>$::group\-Names () const}\label{classKUser_a21}


Returns all group names of the user. 

\begin{Desc}
\item[Returns:]all group names of the user \end{Desc}


Definition at line 229 of file kuser.cpp.

References KUser\-Group::all\-Groups(), QValue\-List::begin(), QValue\-List::end(), and QValue\-List::find().\index{KUser@{KUser}!allUsers@{allUsers}}
\index{allUsers@{allUsers}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf QValue\-List}$<$ {\bf KUser} $>$ {\bf KUser}$<$ T $>$::all\-Users ()\hspace{0.3cm}{\tt  [static]}}\label{classKUser_e0}


Returns all users of the system. 

\begin{Desc}
\item[Returns:]all users of the system. \end{Desc}


Definition at line 243 of file kuser.cpp.

References QValue\-List::append(), and KUser$<$ T $>$::KUser().\index{KUser@{KUser}!allUserNames@{allUserNames}}
\index{allUserNames@{allUserNames}!KUser@{KUser}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf QString\-List} {\bf KUser}$<$ T $>$::all\-User\-Names ()\hspace{0.3cm}{\tt  [static]}}\label{classKUser_e1}


Returns all user names of the system. 

\begin{Desc}
\item[Returns:]all user names of the system. \end{Desc}


Definition at line 257 of file kuser.cpp.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kuser.h\item 
kuser.cpp\end{CompactItemize}
