00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef XAPIAN_INCLUDED_VALUESETMATCHDECIDER_H
00024 #define XAPIAN_INCLUDED_VALUESETMATCHDECIDER_H
00025
00026 #include <xapian/enquire.h>
00027 #include <xapian/types.h>
00028
00029 #include <string>
00030 #include <set>
00031
00032 namespace Xapian {
00033
00034 class Document;
00035
00039 class XAPIAN_VISIBILITY_DEFAULT ValueSetMatchDecider : public MatchDecider {
00041 std::set<std::string> testset;
00042
00044 valueno valuenum;
00045
00051 bool inclusive;
00052
00053 public:
00063 ValueSetMatchDecider(Xapian::valueno slot, bool inclusive_)
00064 : valuenum(slot), inclusive(inclusive_) { }
00065
00070 void add_value(const std::string& value)
00071 {
00072 testset.insert(value);
00073 }
00074
00079 void remove_value(const std::string& value)
00080 {
00081 testset.erase(value);
00082 }
00083
00090 bool operator()(const Xapian::Document& doc) const;
00091 };
00092
00093 }
00094
00095 #endif