Debian Codegraph @

CodeLite/clWildMatch.hpp

raw
1 #ifndef CLWILDMATCH_HPP
2 #define CLWILDMATCH_HPP
3
4 #include "codelite_exports.h"
5
6 #include <vector>
7 #include <wx/arrstr.h>
8 #include <wx/string.h>
9
10 struct _Mask {
11 wxString pattern;
12 bool is_wild = false;
13
14 _Mask(const wxString& pat, bool b)
15 : pattern(pat)
16 , is_wild(b)
17 {
18 }
19 };
20
21 class WXDLLIMPEXP_CL clFileExtensionMatcher
22 {
23 wxString m_mask;
24 std::vector<_Mask> m_include_mask;
25 bool m_always_matches = false;
26
27 public:
28 clFileExtensionMatcher(const wxString& mask);
29 ~clFileExtensionMatcher();
30
31 bool matches(const wxString& filename) const;
32 };
33
34 class WXDLLIMPEXP_CL clPathExcluder
35 {
36 wxString m_mask;
37 std::vector<_Mask> m_exclude_mask;
38
39 public:
40 clPathExcluder(const wxString& mask);
41 /**
42 * @brief construct an excluder from a a list of exclude pattern
43 */
44 clPathExcluder(const wxArrayString& patterns);
45
46 ~clPathExcluder();
47 bool is_exclude_path(const wxString& path) const;
48 };
49
50 #endif // CLWILDMATCH_HPP