.TH "FBB::User" "3bobcat" "2005\-2012" "libbobcat1\-dev_3\&.01\&.00\-x\&.tar\&.gz" "/etc/passwd user info" .PP .SH "NAME" FBB::User \- Provides the \fI/etc/passwd\fP info of the current user .PP .SH "SYNOPSIS" \fB#include \fP .br Linking option: \fI\-lbobcat\fP .PP .SH "DESCRIPTION" This class retrieves the information of the current user from the information in \fI/etc/passwd\fP\&. The class is a simple wrapper class around the \fBgetpwent\fP(3) function\&. .PP .SH "NAMESPACE" \fBFBB\fP .br All constructors, members, operators and manipulators, mentioned in this man\-page, are defined in the namespace \fBFBB\fP\&. .PP .SH "INHERITS FROM" \- .PP .SH "CONSTRUCTORS" .IP o \fBUser()\fP: .br The default constructor determines the current user\(cq\&s data\&. This constructor throws an \fIErrno\fP exception if it did not properly complete because the current user name could not be found in \fI/etc/passwd\fP\&. The copy and move constructors are available\&. .PP .SH "OVERLOADED OPERATORS" .PP The copy and move assignment operators are available\&. .PP .SH "MEMBER FUNCTIONS" .IP o \fBsize_t groupid() const\fP: .br Returns the user\(cq\&s group\-id\&. .IP o \fBstd::string homedir() const\fP: .br Returns the user\(cq\&s home directory (including a trailing \fI/\fP)\&. .IP o \fBstd::string name() const\fP: .br Returns the user\(cq\&s user\-name\&. .IP o \fBstd::string password() const\fP: .br Returns the user\(cq\&s encrypted password\&. But see also the \fBBUGS\fP section\&. .IP o \fBstd::string realname() const\fP: .br Returns the user\(cq\&s real name, as listed in the \fI/etc/passwd\fP\(cq\&s \fIgecos\fP field\&. .IP o \fBstd::string shell() const\fP: .br Returns the user\(cq\&s shell\&. .IP o \fBsize_t userid() const\fP: .br Returns the user\(cq\&s user\-id\&. .IP o \fBvoid verify() const\fP: .br Obsoleted, will be removed in a future Bobcat release\&. .PP .SH "EXAMPLE" .nf #include #include using namespace std; using namespace FBB; int main() { User user; user\&.verify(); cout << \(dq\&\en\(dq\& \(dq\&name : \(dq\& << user\&.name() << \(dq\&\en\(dq\& << \(dq\&password : \(dq\& << user\&.password() << \(dq\&\en\(dq\& << \(dq\&user id : \(dq\& << user\&.userid() << \(dq\&\en\(dq\& << \(dq\&group id : \(dq\& << user\&.groupid() << \(dq\&\en\(dq\& << \(dq\&real name : \(dq\& << user\&.realname() << \(dq\&\en\(dq\& << \(dq\&home dir : \(dq\& << user\&.homedir() << \(dq\&\en\(dq\& << \(dq\&shell : \(dq\& << user\&.shell() << \(dq\&\en\(dq\& << endl; return 0; } .fi .PP .SH "FILES" \fIbobcat/user\fP \- defines the class interface .PP .SH "SEE ALSO" \fBbobcat\fP(7), \fBgetpwent\fP(3) .PP .SH "BUGS" If the user is a member of multiple groups, only the group id listed in \fI/etc/passwd\fP is returned by \fBgroupid()\fP\&. .PP If shadow passwording is used, the string returned by \fBpassword()\fP will probably not contain the encrypted password\&. .PP .SH "DISTRIBUTION FILES" .IP o \fIbobcat_3\&.01\&.00\-x\&.dsc\fP: detached signature; .IP o \fIbobcat_3\&.01\&.00\-x\&.tar\&.gz\fP: source archive; .IP o \fIbobcat_3\&.01\&.00\-x_i386\&.changes\fP: change log; .IP o \fIlibbobcat1_3\&.01\&.00\-x_*\&.deb\fP: debian package holding the libraries; .IP o \fIlibbobcat1\-dev_3\&.01\&.00\-x_*\&.deb\fP: debian package holding the libraries, headers and manual pages; .IP o \fIhttp://sourceforge\&.net/projects/bobcat\fP: public archive location; .PP .SH "BOBCAT" Bobcat is an acronym of `Brokken\(cq\&s Own Base Classes And Templates\(cq\&\&. .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP