summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/FSKit/IndexableProperty.h
blob: 6a79bc1b4d88084432c6f9d69880dfc51b6d1d59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* -------------------------------------------

	Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.

------------------------------------------- */

#pragma once

#include <CFKit/Property.h>
#include <CompilerKit/CompilerKit.h>
#include <KernelKit/DriveMgr.h>

#define kIndexerCatalogNameLength 256U
#define kIndexerClaimed			  0xCF

namespace NeOS
{
	namespace Indexer
	{
		struct IndexProperty final
		{
		public:
			Char Drive[kDriveNameLen];
			Char Path[kIndexerCatalogNameLength];
		};

		class IndexableProperty final : public Property
		{
		public:
			explicit IndexableProperty()
				: Property()
			{
				NeOS::KString strProp(kMaxPropLen);
				strProp += "/prop/indexable";

				this->GetKey() = strProp;
			}

			~IndexableProperty() override = default;

			NE_COPY_DEFAULT(IndexableProperty);

		public:
			IndexProperty& Leak() 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 NeOS