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_queryParser_QueryToken_ 00008 #define _lucene_queryParser_QueryToken_ 00009 00010 00011 //#include "QueryParserBase.h" 00012 00013 CL_NS_DEF(queryParser) 00014 00015 // Token class that used by QueryParser. 00016 class QueryToken:LUCENE_BASE 00017 { 00018 public: 00019 enum Types 00020 { 00021 AND_, 00022 OR, 00023 NOT, 00024 PLUS, 00025 MINUS, 00026 LPAREN, 00027 RPAREN, 00028 COLON, 00029 CARAT, 00030 QUOTED, 00031 TERM, 00032 SLOP, 00033 FUZZY, 00034 PREFIXTERM, 00035 WILDTERM, 00036 RANGEIN, 00037 RANGEEX, 00038 NUMBER, 00039 EOF_, 00040 UNKNOWN_ 00041 }; 00042 00043 00044 #ifdef LUCENE_TOKEN_WORD_LENGTH 00045 TCHAR Value[LUCENE_TOKEN_WORD_LENGTH+1]; 00046 #else 00047 TCHAR* Value; 00048 #endif 00049 00050 int32_t Start; 00051 int32_t End; 00052 QueryToken::Types Type; 00053 00054 // Initializes a new instance of the Token class. 00055 QueryToken(const TCHAR* value, const int32_t start, const int32_t end, const Types type); 00056 00057 // Initializes a new instance of the Token class. 00058 QueryToken(const TCHAR* value, const Types type); 00059 00060 // Initializes a new instance of the Token class. 00061 QueryToken(Types type); 00062 00063 // Initializes an empty instance of the Token class. 00064 QueryToken(); 00065 00066 ~QueryToken(); 00067 00068 void set(const TCHAR* value, const int32_t start, const int32_t end, const Types type); 00069 void set(const TCHAR* value, const Types type); 00070 void set(Types type); 00071 }; 00072 CL_NS_END 00073 #endif