/usr/include/xapian/expanddecider.h is in libxapian-dev 1.2.19-1+deb8u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | /** @file expanddecider.h
* @brief Allow rejection of terms during ESet generation.
*/
/* Copyright (C) 2007,2011 Olly Betts
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef XAPIAN_INCLUDED_EXPANDDECIDER_H
#define XAPIAN_INCLUDED_EXPANDDECIDER_H
#include <set>
#include <string>
#include <xapian/visibility.h>
namespace Xapian {
/** Virtual base class for expand decider functor. */
class XAPIAN_VISIBILITY_DEFAULT ExpandDecider {
public:
/** Do we want this term in the ESet?
*
* @param term The term to test.
*/
virtual bool operator()(const std::string &term) const = 0;
/** Virtual destructor, because we have virtual methods. */
virtual ~ExpandDecider();
};
/** ExpandDecider subclass which rejects terms using two ExpandDeciders.
*
* Terms are only accepted if they are accepted by both of the specified
* ExpandDecider objects.
*/
class XAPIAN_VISIBILITY_DEFAULT ExpandDeciderAnd : public ExpandDecider {
const ExpandDecider &first, &second;
public:
/** Terms will be checked with @a first, and if accepted, then checked
* with @a second.
*
* @param first_ First ExpandDecider object to test with.
* @param second_ ExpandDecider object to test with if first_ accepts.
*/
ExpandDeciderAnd(const ExpandDecider &first_,
const ExpandDecider &second_)
: first(first_), second(second_) { }
/** Compatibility method.
*
* @param first_ First ExpandDecider object to test with.
* @param second_ ExpandDecider object to test with if first_ accepts.
*/
ExpandDeciderAnd(const ExpandDecider *first_,
const ExpandDecider *second_)
: first(*first_), second(*second_) { }
virtual bool operator()(const std::string &term) const;
};
/** ExpandDecider subclass which rejects terms in a specified list.
*
* ExpandDeciderFilterTerms provides an easy way to filter out terms from
* a fixed list when generating an ESet.
*/
class XAPIAN_VISIBILITY_DEFAULT ExpandDeciderFilterTerms : public ExpandDecider {
std::set<std::string> rejects;
public:
/** The two iterators specify a list of terms to be rejected.
*
* @param reject_begin Begin iterator for the list of terms to
* reject. It can be any input_iterator type
* which returns std::string or char * (e.g.
* TermIterator or char **).
* @param reject_end End iterator for the list of terms to reject.
*/
template <class Iterator>
ExpandDeciderFilterTerms(Iterator reject_begin, Iterator reject_end)
: rejects(reject_begin, reject_end) { }
virtual bool operator()(const std::string &term) const;
};
}
#endif // XAPIAN_INCLUDED_EXPANDDECIDER_H
|