diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-24 03:02:43 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-24 03:02:43 +0100 |
| commit | 83d870e58457a1d335a1d9b9966a6a1887cc297b (patch) | |
| tree | 72888f88c7728c82f3f6df1f4f70591de15eab36 /src/kernel/FSKit/IndexableProperty.h | |
| parent | ab37adbacf0f33845804c788b39680cd754752a8 (diff) | |
feat! breaking changes on kernel sources.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/kernel/FSKit/IndexableProperty.h')
| -rw-r--r-- | src/kernel/FSKit/IndexableProperty.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/kernel/FSKit/IndexableProperty.h b/src/kernel/FSKit/IndexableProperty.h new file mode 100644 index 00000000..a89e78b8 --- /dev/null +++ b/src/kernel/FSKit/IndexableProperty.h @@ -0,0 +1,58 @@ +/* ======================================== + + Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license. + +======================================== */ + +#pragma once + +#include <CFKit/Property.h> +#include <CompilerKit/CompilerKit.h> +#include <KernelKit/DriveMgr.h> + +#define kIndexerCatalogNameLength (256U) +#define kIndexerClaimed (0xCF) +#define kIndexerUnclaimed (0xCA) + +namespace Kernel { +namespace Indexer { + struct Index final { + public: + Char Drive[kDriveNameLen]{}; + Char Path[kIndexerCatalogNameLength]{}; + }; + + class IndexableProperty final : public Property { + public: + explicit IndexableProperty() : Property() { + KBasicString<> strProp(kMaxPropLen); + strProp += "/prop/indexable"; + + this->GetKey() = strProp; + } + + ~IndexableProperty() override = default; + + NE_COPY_DEFAULT(IndexableProperty) + + public: + Index& Leak() noexcept; + + public: + Void AddFlag(UInt16 flag); + Void RemoveFlag(UInt16 flag); + UInt16 HasFlag(UInt16 flag); + + private: + Index 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 Kernel |
