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_PhrasePositions_ 00008 #define _lucene_search_PhrasePositions_ 00009 00010 #if defined(_LUCENE_PRAGMA_ONCE) 00011 # pragma once 00012 #endif 00013 00014 #include "CLucene/index/Terms.h" 00015 00016 CL_NS_DEF(search) 00017 00018 class PhrasePositions:LUCENE_BASE { 00019 public: 00020 int32_t doc; // current doc 00021 int32_t position; // position in doc 00022 int32_t count; // remaining pos in this doc 00023 int32_t offset; // position in phrase 00024 CL_NS(index)::TermPositions* tp; // stream of positions 00025 PhrasePositions* _next; // used to make lists 00026 00027 00028 //Constructor 00029 PhrasePositions(CL_NS(index)::TermPositions* Tp, const int32_t o); 00030 //Destructor 00031 ~PhrasePositions(); 00032 00033 bool next(); 00034 bool skipTo(int32_t target); 00035 00036 void firstPosition(); 00037 00038 bool nextPosition(); 00039 }; 00040 CL_NS_END 00041 #endif