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 
29 class Group;
30 
33 {
34  public:
44  User(
45  size_t uid, String username, String fullName, Group *pGroup,
46  String home, String shell, String password);
47 
49  virtual ~User();
50 
52  void join(Group *pGroup);
53 
55  void leave(Group *pGroup);
56 
58  bool isMember(Group *pGroup);
59 
63  bool login(String password);
64 
66  size_t getId()
67  {
68  return m_Uid;
69  }
72  {
73  return m_Username;
74  }
77  {
78  return m_FullName;
79  }
82  {
83  return m_pDefaultGroup;
84  }
87  {
88  return m_Home;
89  }
92  {
93  return m_Shell;
94  }
95 
96  private:
99  User();
100  User(const User &);
101  User &operator=(const User &);
102 
104  size_t m_Uid;
117 
120 };
121 
122 #endif
List< Group * > m_Groups
Definition: User.h:119
String getUsername()
Definition: User.h:71
size_t getId()
Definition: User.h:66
size_t m_Uid
Definition: User.h:104
String m_Shell
Definition: User.h:114
Definition: String.h:49
String m_Password
Definition: User.h:116
String m_FullName
Definition: User.h:108
Definition: User.h:32
String getShell()
Definition: User.h:91
String getHome()
Definition: User.h:86
Group * m_pDefaultGroup
Definition: User.h:110
String getFullName()
Definition: User.h:76
Group * getDefaultGroup()
Definition: User.h:81
String m_Username
Definition: User.h:106
String m_Home
Definition: User.h:112
Definition: Group.h:32