fswatch  1.14.0
filter.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2015 Enrico M. Crisostomo
3  *
4  * This program is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU General Public License as published by the Free Software
6  * Foundation; either version 3, or (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU General Public License along with
14  * this program. If not, see <http://www.gnu.org/licenses/>.
15  */
28 #ifndef FSW__FILTER_H
29 # define FSW__FILTER_H
30 
31 # include <string>
32 # include "../c/cfilter.h"
33 # include <vector>
34 
35 namespace fsw
36 {
58  typedef struct monitor_filter
59  {
67  std::string text;
68 
73 
79 
88  bool extended;
89 
120  static std::vector<monitor_filter> read_from_file(const std::string& path,
121  void (*err_handler)(
122  std::string) = nullptr);
123  } monitor_filter;
124 }
125 
126 #endif /* FSW__FILTER_H */
Main namespace of libfswatch.
Definition: event.cpp:23
fsw_filter_type
Event filter type.
Definition: cfilter.h:38
fsw_filter_type type
Filter type.
Definition: filter.hpp:72
std::string text
Regular expression used to match the paths.
Definition: filter.hpp:67
struct fsw::monitor_filter monitor_filter
Path filters used to accept or reject file change events.
bool extended
Flag indicating whether monitor_filter::text is an extended regular expression.
Definition: filter.hpp:88
bool case_sensitive
Flag indicating whether monitor_filter::text is a case sensitive regular expression.
Definition: filter.hpp:78
static std::vector< monitor_filter > read_from_file(const std::string &path, void(*err_handler)(std::string)=nullptr)
Load filters from the specified file.
Definition: filter.cpp:36
Path filters used to accept or reject file change events.
Definition: filter.hpp:58