xref: /haiku/src/add-ons/index_server/fulltext/FullTextAnalyser.h (revision 17889a8c70dbb3d59c1412f6431968753c767bab)
1 /*
2  * Copyright 2010, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Clemens Zeidler <haiku@clemens-zeidler.de>
7  */
8 #ifndef FULL_TEXT_ANALYSER_H
9 #define FULL_TEXT_ANALYSER_H
10 
11 
12 #include "IndexServerAddOn.h"
13 
14 #include <Path.h>
15 
16 #include "TextDataBase.h"
17 
18 
19 const char* kFullTextDirectory = "FullTextAnalyser";
20 
21 
22 class FullTextAnalyser : public FileAnalyser {
23 public:
24 								FullTextAnalyser(BString name,
25 									const BVolume& volume);
26 								~FullTextAnalyser();
27 
28 			status_t			InitCheck();
29 
30 			void				AnalyseEntry(const entry_ref& ref);
31 			void				DeleteEntry(const entry_ref& ref);
32 			void				MoveEntry(const entry_ref& oldRef,
33 									const entry_ref& newRef);
34 			void				LastEntry();
35 
36 private:
37 	inline	bool				_InterestingEntry(const entry_ref& ref);
38 	inline	bool				_IsInIndexDirectory(const entry_ref& ref);
39 
40 			TextWriteDataBase*	fWriteDataBase;
41 			BPath				fDataBasePath;
42 
43 			uint32				fNUncommited;
44 };
45 
46 
47 class FullTextAddOn : public IndexServerAddOn {
48 public:
49 								FullTextAddOn(image_id id, const char* name);
50 
51 			FileAnalyser*		CreateFileAnalyser(const BVolume& volume);
52 };
53 
54 #endif
55