1 // -*- mode: cpp; mode: fold -*-
3 // $Id: filefilter.h,v 1.2 1998/12/30 05:36:41 jgg Exp $
4 /* ######################################################################
6 File Filter - Regular Expression maching filter
8 This implements an ordered include/exclude filter list that can be used
11 Pattern matching is done identically to rsync, the key points are:
12 - Patterns containing / are matched against the whole path, otherwise
13 only the file name is used.
14 - Patterns that end in a / only match directories
15 - Wildcards supported by fnmatch (?*[)
17 ##################################################################### */
19 #ifndef DSYNC_FILEFILTER
20 #define DSYNC_FILEFILTER
23 #pragma interface "dsync/filefilter.h"
27 #include <dsync/configuration.h>
35 enum {Include, Exclude} Type;
39 enum {MatchAll = (1<<0), MatchPath = (1<<1)};
44 bool Test(const char *Directory,const char *File);
50 // Members to see if the filter hits or misses
51 bool Test(const char *Directory,const char *File);
53 // Load the filter from a configuration space
54 bool LoadFilter(Configuration::Item const *Root);