summaryrefslogtreecommitdiffhomepage
path: root/Kernel/FSKit/IndexableProperty.hxx
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-09 00:42:44 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-09 00:42:44 +0200
commitaf8a516fc22865abd80d6e26f1541fa3d6bebfdc (patch)
tree96d42a10945fc03df022389aef54708383c1d616 /Kernel/FSKit/IndexableProperty.hxx
parenta874e9cc98df994178d55996943fe81799c61d2f (diff)
MHR-23: :boom:, refactors.
- Move NewBoot to /Boot, thus making Kernel directory only containing the kernel. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Kernel/FSKit/IndexableProperty.hxx')
-rw-r--r--Kernel/FSKit/IndexableProperty.hxx58
1 files changed, 58 insertions, 0 deletions
diff --git a/Kernel/FSKit/IndexableProperty.hxx b/Kernel/FSKit/IndexableProperty.hxx
new file mode 100644
index 00000000..eae15317
--- /dev/null
+++ b/Kernel/FSKit/IndexableProperty.hxx
@@ -0,0 +1,58 @@
+/* -------------------------------------------
+
+ Copyright SoftwareLabs
+
+------------------------------------------- */
+
+#pragma once
+
+#include <CFKit/Property.hpp>
+#include <CompilerKit/CompilerKit.hxx>
+#include <KernelKit/DriveManager.hxx>
+
+#define kIndexerNodeNameLength 256
+#define kIndexerClaimed 0xCF
+
+namespace NewOS
+{
+ namespace Indexer
+ {
+ struct IndexProperty final
+ {
+ public:
+ Char Drive[kDriveNameLen];
+ Char Path[kIndexerNodeNameLength];
+ };
+
+ class IndexableProperty final : public Property
+ {
+ public:
+ explicit IndexableProperty()
+ : Property(StringBuilder::Construct("IndexableProperty").Leak().Leak())
+ {
+ }
+ ~IndexableProperty() override = default;
+
+ NEWOS_COPY_DEFAULT(IndexableProperty);
+
+ public:
+ IndexProperty& LeakProperty() noexcept;
+
+ public:
+ void AddFlag(Int16 flag);
+ void RemoveFlag(Int16 flag);
+ Int16 HasFlag(Int16 flag);
+
+ private:
+ IndexProperty fIndex;
+ UInt32 fFlags;
+ };
+
+ /// @brief Index a file into the indexer instance.
+ /// @param filename path
+ /// @param filenameLen used bytes in path.
+ /// @param indexer the filesystem indexer.
+ /// @return none.
+ Void fs_index_file(const Char* filename, SizeT filenameLen, IndexableProperty& indexer);
+ } // namespace Indexer
+} // namespace NewOS