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.
6 #ifndef INITIAL_ITERATOR_H
7 #define INITIAL_ITERATOR_H
12 #include "FileIterator.h"
18 // TODO: split into Folder and MessageFileIterator (_GetTopEntry)
19 // This code either has an original folder to start iterating from,
20 // or it uses the refs in the message that contains the selected poses
21 // from the Tracker window that invoked us. But I think if folders are
22 // among those poses, it will then use the same code for examining sub
25 // Provides an interface to retrieve the next file that should be grepped
26 // for the search string.
27 class InitialIterator
: public FileIterator
{
29 InitialIterator(const Model
* model
);
30 virtual ~InitialIterator();
32 virtual bool IsValid() const;
33 virtual bool GetNextName(char* buffer
);
34 virtual bool NotifyNegatives() const;
36 // Looks for the next entry in the top-level dir.
37 bool GetTopEntry(BEntry
& entry
);
39 // Should this subfolder be followed?
40 bool FollowSubdir(BEntry
& entry
) const;
43 // Looks for the next entry.
44 bool _GetNextEntry(BEntry
& entry
);
46 // Looks for the next entry in a subdir.
47 bool _GetSubEntry(BEntry
& entry
);
49 // Determines whether we can add a subdir.
50 void _ExamineSubdir(BEntry
& entry
);
53 // Contains pointers to BDirectory objects.
56 // The directory we are currently looking at.
57 BDirectory
* fCurrentDir
;
59 // The ref number we are currently looking at.
62 // The current settings
63 BMessage fSelectedFiles
;
65 bool fRecurseDirs
: 1;
66 bool fRecurseLinks
: 1;
67 bool fSkipDotDirs
: 1;
71 #endif // INITIAL_ITERATOR_H