22 #ifndef XAPIAN_INCLUDED_KEYMAKER_H
23 #define XAPIAN_INCLUDED_KEYMAKER_H
25 #if !defined XAPIAN_IN_XAPIAN_H && !defined XAPIAN_LIB_BUILD
26 # error Never use <xapian/keymaker.h> directly; include <xapian.h> instead.
30 #include <string_view>
80 virtual std::string
name()
const;
90 virtual std::string serialise()
const;
113 virtual KeyMaker* unserialise(
const std::string& serialised,
124 opt_intrusive_base::release();
136 opt_intrusive_base::release();
162 std::string_view defvalue_)
163 : slot(slot_), reverse(reverse_), defvalue(defvalue_)
176 template<
class Iterator>
178 while (begin != end) add_value(*begin++);
196 std::string_view defvalue = {}) {
197 slots.push_back(KeySpec(slot, reverse, defvalue));
200 std::string
name()
const;
202 std::string serialise()
const;
204 KeyMaker* unserialise(
const std::string& serialised,
205 const Registry& context)
const;
Class representing a document.
Base class for objects managed by opt_intrusive_ptr.
Virtual base class for key making functors.
const KeyMaker * release() const
Start reference counting this object.
KeyMaker()
Default constructor.
KeyMaker(const KeyMaker &)=delete
Don't allow copying.
void operator=(const KeyMaker &)=delete
Don't allow assignment.
virtual std::string operator()(const Xapian::Document &doc) const =0
Build a key string for a Document.
KeyMaker * release()
Start reference counting this object.
KeyMaker subclass which combines several values.
void add_value(Xapian::valueno slot, bool reverse=false, std::string_view defvalue={})
Add a value slot to the list to build a key from.
MultiValueKeyMaker(Iterator begin, Iterator end)
Construct a MultiValueKeyMaker from a pair of iterators.
std::vector< KeySpec > slots
Registry for user subclasses.
The Xapian namespace contains public interfaces for the Xapian library.
unsigned valueno
The number for a value slot in a document.
KeySpec(Xapian::valueno slot_, bool reverse_, std::string_view defvalue_)
Define XAPIAN_VISIBILITY_* macros.
#define XAPIAN_VISIBILITY_DEFAULT