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_index_FieldsReader_ 00008 #define _lucene_index_FieldsReader_ 00009 00010 #if defined(_LUCENE_PRAGMA_ONCE) 00011 # pragma once 00012 #endif 00013 00014 #include "CLucene/util/VoidMap.h" 00015 #include "CLucene/store/Directory.h" 00016 #include "CLucene/document/Document.h" 00017 #include "CLucene/document/Field.h" 00018 #include "FieldInfos.h" 00019 #include "CLucene/util/subinputstream.h" 00020 #include "CLucene/store/IndexInput.h" 00021 00022 CL_NS_DEF(index) 00023 00024 00029 class FieldsReader :LUCENE_BASE{ 00030 private: 00031 const FieldInfos* fieldInfos; 00032 CL_NS(store)::IndexInput* fieldsStream; 00033 CL_NS(store)::IndexInput* indexStream; 00034 int32_t _size; 00035 00036 class FieldsStreamHolder: public jstreams::StreamBase<char>{ 00037 CL_NS(store)::IndexInput* indexInput; 00038 CL_NS(store)::IndexInputStream* indexInputStream; 00039 jstreams::SubInputStream<char>* subStream; 00040 public: 00041 FieldsStreamHolder(CL_NS(store)::IndexInput* indexInput, int32_t subLength); 00042 ~FieldsStreamHolder(); 00043 int32_t read(const char*& start, int32_t _min, int32_t _max); 00044 int64_t skip(int64_t ntoskip); 00045 int64_t reset(int64_t pos); 00046 }; 00047 public: 00048 FieldsReader(CL_NS(store)::Directory* d, const char* segment, FieldInfos* fn); 00049 ~FieldsReader(); 00050 void close(); 00051 int32_t size() const; 00053 bool doc(int32_t n, CL_NS(document)::Document* doc); 00054 }; 00055 CL_NS_END 00056 #endif