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_FieldsWriter_ 00008 #define _lucene_index_FieldsWriter_ 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/store/IndexOutput.h" 00017 #include "CLucene/document/Document.h" 00018 #include "CLucene/document/Field.h" 00019 #include "FieldInfos.h" 00020 00021 CL_NS_DEF(index) 00022 class FieldsWriter :LUCENE_BASE{ 00023 private: 00024 FieldInfos* fieldInfos; 00025 00026 CL_NS(store)::IndexOutput* fieldsStream; 00027 CL_NS(store)::IndexOutput* indexStream; 00028 00029 public: 00030 LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_TOKENIZED = 0x1); 00031 LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_BINARY = 0x2); 00032 LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_COMPRESSED = 0x4); 00033 00034 FieldsWriter(CL_NS(store)::Directory* d, const char* segment, FieldInfos* fn); 00035 ~FieldsWriter(); 00036 00037 void close(); 00038 00039 void addDocument(CL_NS(document)::Document* doc); 00040 }; 00041 CL_NS_END 00042 #endif