The Pedigree Project 0.1
User.h
1/*
2 * Copyright (c) 2008-2014, Pedigree Developers
3 *
4 * Please see the CONTRIB file in the root of the source tree for a full
5 * list of contributors.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#ifndef USER_H
21#define USER_H
22
23#include "pedigree/kernel/compiler.h"
24#include "pedigree/kernel/processor/types.h"
25#include "pedigree/kernel/utilities/List.h"
26#include "pedigree/kernel/utilities/String.h"
27#include "pedigree/kernel/utilities/new"
28
29class Group;
30
32class EXPORTED_PUBLIC User {
33 public:
41 User(size_t uid, const String& username, const String& fullName, Group* pGroup,
42 const String& home, const String& shell);
43
45 virtual ~User();
46
48 void join(Group* pGroup);
49
51 void leave(Group* pGroup);
52
54 bool isMember(Group* pGroup);
55
57 bool login();
58
60 size_t getId() const {
61 return m_Uid;
62 }
64 const String& getUsername() const {
65 return m_Username;
66 }
68 const String& getFullName() const {
69 return m_FullName;
70 }
73 return m_pDefaultGroup;
74 }
76 const String& getHome() const {
77 return m_Home;
78 }
80 const String& getShell() const {
81 return m_Shell;
82 }
83
84 private:
88 User(const User&);
89 User& operator=(const User&);
90
92 size_t m_Uid;
105};
106
107#endif
Definition Group.h:32
Definition List.h:61
Definition User.h:32
size_t getId() const
Definition User.h:60
const String & getFullName() const
Definition User.h:68
const String & getUsername() const
Definition User.h:64
String m_Home
Definition User.h:100
Group * getDefaultGroup()
Definition User.h:72
String m_FullName
Definition User.h:96
String m_Username
Definition User.h:94
size_t m_Uid
Definition User.h:92
String m_Shell
Definition User.h:102
const String & getHome() const
Definition User.h:76
List< Group * > m_Groups
Definition User.h:104
const String & getShell() const
Definition User.h:80
Group * m_pDefaultGroup
Definition User.h:98