summaryrefslogtreecommitdiffhomepage
path: root/Kernel/FSKit/IndexableProperty.hxx
blob: 1c8aafeba410221cc74bfc4834864ffd591f6860 (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
/* -------------------------------------------

	Copyright SoftwareLabs

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

#pragma once

#include <CFKit/Property.hpp>
#include <CompilerKit/CompilerKit.hxx>
#include <KernelKit/DriveManager.hxx>

#define kIndexerNodeNameLength 255
#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