eVaf
ifilefinder.h
Go to the documentation of this file.
1 
20 #ifndef __FILEFINDER_ENGINE_IFILEFINDER_H
21 # define __FILEFINDER_ENGINE_IFILEFINDER_H
22 
23 #include <QObject>
24 #include <QString>
25 
26 namespace eVaf {
27 namespace FileFinder {
28 
43 struct Filter
44 {
46  {}
47 
48  Filter(QString const & in, QString const & en, QString const & ic, QString const & ec)
49  : includeNames(in)
50  , excludeNames(en)
51  , includeContent(ic)
52  , excludeContent(ec)
53  {}
54 
56  QString includeNames;
57 
59  QString excludeNames;
60 
62  QString includeContent;
63 
65  QString excludeContent;
66 };
67 
73 class iFileFinder : public QObject
74 {
75  Q_OBJECT
76 
77 public:
78 
81 
83  virtual ~iFileFinder() {}
84 
101  virtual void search(QString const & dir, bool recursive, Filter const & filter) = 0;
102 
106  virtual void cancel() = 0;
107 
111  virtual bool busy() const = 0;
112 
113 
114 signals:
115 
121  void found(QString const & fileName, QString const & dir);
122 
127  void finished(bool canceled);
128 
129 };
130 
131 
132 } // namespace eVaf::FileFinder
133 } // namespace eVaf
134 
135 Q_DECLARE_INTERFACE(eVaf::FileFinder::iFileFinder, "eVaf.FileFinder.iFileFinder/1.0")
136 
137 #endif // ifilefinder.h
File finder interface.
Definition: ifilefinder.h:73
virtual ~iFileFinder()
Empty virtual destructor.
Definition: ifilefinder.h:83
QString includeNames
QRegExp expression specifying file names that are included in the search result.
Definition: ifilefinder.h:56
iFileFinder()
Interface constructor.
Definition: ifilefinder.h:80
Filter(QString const &in, QString const &en, QString const &ic, QString const &ec)
Definition: ifilefinder.h:48
QString excludeNames
QRegExp expression specifying file names that are excluded from the search result.
Definition: ifilefinder.h:59
QString includeContent
QRegExp expression specifying file content that is included in the search result. ...
Definition: ifilefinder.h:62
Global eVaf namespace.
Definition: engine.h:37
QString excludeContent
QRegExp expression specifying file content that is excluded from the search result.
Definition: ifilefinder.h:65
File filter defining patterns for file names and contents.
Definition: ifilefinder.h:43