summaryrefslogtreecommitdiffhomepage
path: root/Kernel/Sources/User.cxx
diff options
context:
space:
mode:
authorAmlal <amlal@zka.com>2024-07-23 12:02:10 +0200
committerAmlal <amlal@zka.com>2024-07-23 12:02:10 +0200
commit274cba18b8f1c255ddcff2f5c14aab4d0c846820 (patch)
treeaa56d2223c79d447b85a2bfefdbaab90b25fc8fe /Kernel/Sources/User.cxx
parent8eee31685e4334415870bb00b11b6b0d29821f10 (diff)
[IMP] User class and current user global.
[REMOVE] ApplicationInterface struct. [IMP] DDK_STATUS_STRUCT data structure for driver events. Signed-off-by: Amlal <amlal@zka.com>
Diffstat (limited to 'Kernel/Sources/User.cxx')
-rw-r--r--Kernel/Sources/User.cxx54
1 files changed, 54 insertions, 0 deletions
diff --git a/Kernel/Sources/User.cxx b/Kernel/Sources/User.cxx
new file mode 100644
index 00000000..1deac5be
--- /dev/null
+++ b/Kernel/Sources/User.cxx
@@ -0,0 +1,54 @@
+/*
+ * ========================================================
+ *
+ * Kernel
+ * Copyright ZKA Technologies, all rights reserved.
+ *
+ * File: User.cpp
+ * Purpose: Permission selectors.
+ *
+ * ========================================================
+ */
+
+#include <KernelKit/User.hxx>
+#include <NewKit/KernelCheck.hpp>
+
+/// bugs 0
+
+namespace Kernel
+{
+ User::User(const Int32& sel, const Char* userName)
+ : fRing((RingKind)sel)
+ {
+ MUST_PASS(sel >= 0);
+ this->fUserName += userName;
+ }
+
+ User::User(const RingKind& ringKind, const Char* userName)
+ : fRing(ringKind)
+ {
+ this->fUserName += userName;
+ }
+
+ User::~User() = default;
+
+ bool User::operator==(const User& lhs)
+ {
+ return lhs.fRing == this->fRing;
+ }
+
+ bool User::operator!=(const User& lhs)
+ {
+ return lhs.fRing != this->fRing;
+ }
+
+ const StringView User::Name() noexcept
+ {
+ return this->fUserName;
+ }
+
+ const RingKind& User::Ring() noexcept
+ {
+ return this->fRing;
+ }
+} // namespace Kernel