CLucene - a full-featured, c++ search engine
API Documentation
00001 /*------------------------------------------------------------------------------ 00002 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 00003 * 00004 * Distributable under the terms of either the Apache License (Version 2.0) or 00005 * the GNU Lesser General Public License, as specified in the COPYING file. 00006 ------------------------------------------------------------------------------*/ 00007 #ifndef _lucene_search_Filter_ 00008 #define _lucene_search_Filter_ 00009 00010 #if defined(_LUCENE_PRAGMA_ONCE) 00011 # pragma once 00012 #endif 00013 00014 #include "CLucene/index/IndexReader.h" 00015 #include "CLucene/util/BitSet.h" 00016 00017 CL_NS_DEF(search) 00018 // Abstract base class providing a mechanism to restrict searches to a subset 00019 // of an index. 00020 class Filter: LUCENE_BASE { 00021 public: 00022 virtual ~Filter(){ 00023 } 00024 00025 virtual Filter* clone() const = 0; 00026 00032 virtual CL_NS(util)::BitSet* bits(CL_NS(index)::IndexReader* reader)=0; 00033 00040 virtual bool shouldDeleteBitSet(const CL_NS(util)::BitSet* bs) const{ return true; } 00041 00042 //Creates a user-readable version of this query and returns it as as string 00043 virtual TCHAR* toString()=0; 00044 }; 00045 CL_NS_END 00046 #endif