xref: /haiku/src/apps/text_search/FileIterator.h (revision d17092ceb18bf47a96dbaf8a1acf10e6e3070704)
1 /*
2  * Copyright (c) 2008 Stephan Aßmus <superstippi@gmx.de>
3  * Copyright (c) 1998-2007 Matthijs Hollemans
4  * All rights reserved. Distributed under the terms of the MIT License.
5  */
6 #ifndef FILE_ITERATOR_H
7 #define FILE_ITERATOR_H
8 
9 class BEntry;
10 
11 // Provides an interface to retrieve the next file that should be grepped
12 // for the search string.
13 class FileIterator {
14 public:
15 								FileIterator();
16 	virtual						~FileIterator();
17 
18 	virtual	bool				IsValid() const = 0;
19 
20 	// Returns the full path name of the next file.
21 	virtual	bool				GetNextName(char* buffer) = 0;
22 
23 	// Tells the Grepper whether the targets wants to know about negative hits.
24 	virtual	bool				NotifyNegatives() const = 0;
25 
26 protected:
27 	// Determines whether we can grep a file.
28 			bool				_ExamineFile(BEntry& entry, char* buffer,
29 									bool textFilesOnly);
30 };
31 
32 #endif // FILE_ITERATOR_H
33