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