summaryrefslogtreecommitdiffhomepage
path: root/Private/StorageKit/StorageCore.inl
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-26 22:26:48 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-26 22:27:09 +0100
commiteba8b7ddd0a455d9e49f32dcae712c5612c0093c (patch)
tree749a3d34546d055507a920bce4ab10e8a9945719 /Private/StorageKit/StorageCore.inl
parentdd192787a70a973f2474720aea49af3f6ddabb7a (diff)
Kernel: Major repository refactor.
Rework the repo into Private and Public modules. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/StorageKit/StorageCore.inl')
-rw-r--r--Private/StorageKit/StorageCore.inl56
1 files changed, 56 insertions, 0 deletions
diff --git a/Private/StorageKit/StorageCore.inl b/Private/StorageKit/StorageCore.inl
new file mode 100644
index 00000000..85e2a3f5
--- /dev/null
+++ b/Private/StorageKit/StorageCore.inl
@@ -0,0 +1,56 @@
+/*
+ * ========================================================
+ *
+ * hCore
+ * Copyright 2024 Mahrouss Logic, all rights reserved.
+ *
+ * ========================================================
+ */
+
+#ifndef __STORAGEKIT_STORAGECORE_INL__
+#define __STORAGEKIT_STORAGECORE_INL__
+
+#include <NewKit/Defines.hpp>
+
+// @brief Storage management unit.
+// swap files, files, dirs optimization.
+
+namespace hCore
+{
+ typedef Char* SKStr;
+
+ //! @brief Storage context, reads and write file according to the descriptor layout.
+ class StorageContext
+ {
+ public:
+ explicit StorageContext() = default;
+ ~StorageContext() = default;
+
+ StorageContext& operator=(const StorageContext&) = default;
+ StorageContext(const StorageContext&) = default;
+
+ public:
+ bool Write(VoidPtr fileDescriptor, SizeT sizeFileDescriptor);
+
+ struct SDescriptor
+ {
+ VoidPtr fFilePtr;
+ SizeT fFilePtrSz;
+ };
+
+ SDescriptor Read(const SKStr name);
+
+ };
+
+#define kMaxPathSK 4096
+
+ struct StorageLayout final
+ {
+ Char fName[kMaxPathSK];
+ VoidPtr fData;
+ SizeT fDataSz;
+ Int32 fType;
+ };
+}
+
+#endif /* ifndef __STORAGEKIT_STORAGECORE_INL__ */