xapian-core  1.4.26
Public Member Functions | Protected Attributes | List of all members
Xapian::StringValueRangeProcessor Class Reference

Handle a string range. More...

#include <queryparser.h>

+ Inheritance diagram for Xapian::StringValueRangeProcessor:
+ Collaboration diagram for Xapian::StringValueRangeProcessor:

Public Member Functions

 StringValueRangeProcessor (Xapian::valueno slot_)
 Constructor. More...
 
 StringValueRangeProcessor (Xapian::valueno slot_, const std::string &str_, bool prefix_=true)
 Constructor. More...
 
Xapian::valueno operator() (std::string &begin, std::string &end)
 Check for a valid string range. More...
 
- Public Member Functions inherited from Xapian::ValueRangeProcessor
 ValueRangeProcessor ()
 Default constructor. More...
 
virtual ~ValueRangeProcessor ()
 Destructor. More...
 
ValueRangeProcessorrelease ()
 Start reference counting this object. More...
 
const ValueRangeProcessorrelease () const
 Start reference counting this object. More...
 
- Public Member Functions inherited from Xapian::Internal::opt_intrusive_base
 opt_intrusive_base (const opt_intrusive_base &)
 
opt_intrusive_baseoperator= (const opt_intrusive_base &)
 
 opt_intrusive_base ()
 Construct object which is initially not reference counted. More...
 
virtual ~opt_intrusive_base ()
 
void ref () const
 
void unref () const
 

Protected Attributes

Xapian::valueno valno
 The value slot to process. More...
 
bool prefix
 Whether to look for str as a prefix or suffix. More...
 
std::string str
 The prefix (or suffix if prefix==false) string to look for. More...
 

Additional Inherited Members

- Public Attributes inherited from Xapian::Internal::opt_intrusive_base
unsigned _refs
 Reference count. More...
 
- Protected Member Functions inherited from Xapian::Internal::opt_intrusive_base
void release () const
 Start reference counting. More...
 

Detailed Description

Handle a string range.

The end points can be any strings.

Deprecated:
Use Xapian::RangeProcessor instead (added in 1.3.6).

Definition at line 466 of file queryparser.h.

Constructor & Destructor Documentation

◆ StringValueRangeProcessor() [1/2]

Xapian::StringValueRangeProcessor::StringValueRangeProcessor ( Xapian::valueno  slot_)
inlineexplicit

Constructor.

Parameters
slot_The value number to return from operator().

Definition at line 482 of file queryparser.h.

◆ StringValueRangeProcessor() [2/2]

Xapian::StringValueRangeProcessor::StringValueRangeProcessor ( Xapian::valueno  slot_,
const std::string &  str_,
bool  prefix_ = true 
)
inline

Constructor.

Parameters
slot_The value number to return from operator().
str_A string to look for to recognise values as belonging to this range.
prefix_Flag specifying whether to check for str_ as a prefix or a suffix.

Definition at line 493 of file queryparser.h.

Member Function Documentation

◆ operator()()

Xapian::valueno Xapian::StringValueRangeProcessor::operator() ( std::string &  begin,
std::string &  end 
)
virtual

Check for a valid string range.

Parameters
[in,out]beginThe start of the range as specified in the query string by the user. This parameter is a non-const reference so the ValueRangeProcessor can modify it to return the value to start the range with.
[in,out]endThe end of the range. This is also a non-const reference so it can be modified.
Returns
A StringValueRangeProcessor always accepts a range it is offered, and returns the value of slot_ passed at construction time. It doesn't modify begin or end.

Implements Xapian::ValueRangeProcessor.

Reimplemented in Xapian::NumberValueRangeProcessor, and Xapian::DateValueRangeProcessor.

Definition at line 36 of file valuerangeproc.cc.

References Xapian::BAD_VALUENO, endswith(), startswith(), and Xapian::Internal::str().

Member Data Documentation

◆ prefix

bool Xapian::StringValueRangeProcessor::prefix
protected

Whether to look for str as a prefix or suffix.

Definition at line 472 of file queryparser.h.

◆ str

std::string Xapian::StringValueRangeProcessor::str
protected

The prefix (or suffix if prefix==false) string to look for.

Definition at line 475 of file queryparser.h.

◆ valno

Xapian::valueno Xapian::StringValueRangeProcessor::valno
protected

The value slot to process.

Definition at line 469 of file queryparser.h.


The documentation for this class was generated from the following files: