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_WildcardTermEnum_ 00008 #define _lucene_search_WildcardTermEnum_ 00009 00010 //#include "CLucene/index/IndexReader.h" 00011 CL_CLASS_DEF(index,Term) 00012 CL_CLASS_DEF(index,IndexReader) 00013 //#include "CLucene/index/Terms.h" 00014 #include "FilteredTermEnum.h" 00015 00016 CL_NS_DEF(search) 00024 class CLUCENE_EXPORT WildcardTermEnum: public FilteredTermEnum { 00025 private: 00026 CL_NS(index)::Term* __term; 00027 TCHAR* pre; 00028 int32_t preLen; 00029 bool fieldMatch; 00030 bool _endEnum; 00031 00032 /******************************************** 00033 * const TCHAR* equality with support for wildcards 00034 ********************************************/ 00035 00036 protected: 00037 bool termCompare(CL_NS(index)::Term* term) ; 00038 00039 public: 00040 00047 WildcardTermEnum(CL_NS(index)::IndexReader* reader, CL_NS(index)::Term* term); 00048 ~WildcardTermEnum(); 00049 00050 float_t difference() ; 00051 00052 bool endEnum() ; 00053 00057 static bool wildcardEquals(const TCHAR* pattern, int32_t patternLen, int32_t patternIdx, const TCHAR* str, int32_t strLen, int32_t stringIdx); 00058 00059 void close(); 00060 00061 const char* getObjectName(){ return WildcardTermEnum::getClassName(); } 00062 static const char* getClassName(){ return "WildcardTermEnum"; } 00063 }; 00064 CL_NS_END 00065 #endif