1 /* 2 etree.* - handles expression trees.. Allows to create a predicate 3 that can then be tested against many objects (of the same ClassType) 4 to see if they match the expression. 5 Copyright (C) 1999,2001-2002 Matthew Mueller <donut AT dakotacom.net> 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 2 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; if not, write to the Free Software 19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 */ 21 #ifndef _ETREE_H_ 22 #define _ETREE_H_ 23 #ifdef HAVE_CONFIG_H 24 #include "config.h" 25 #endif 26 #include "argparser.h" 27 28 template <class ClassType> 29 struct pred { 30 virtual bool operator()(const ClassType*) const=0; ~predpred31 virtual ~pred(){} 32 }; 33 34 class c_nntp_file; 35 typedef pred<const c_nntp_file> nntp_file_pred; 36 nntp_file_pred * make_nntpfile_pred(const char *optarg, int gflags); 37 nntp_file_pred * make_nntpfile_pred(const arglist_t &e_parts, int gflags); 38 39 class c_group_availability; 40 typedef pred<const c_group_availability> nntp_grouplist_pred; 41 nntp_grouplist_pred * make_grouplist_pred(const char *optarg, int gflags); 42 nntp_grouplist_pred * make_grouplist_pred(const arglist_t &e_parts, int gflags); 43 44 #endif 45