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