1 /* 2 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 3 * 4 * Distributable under the terms of either the Apache License (Version 2.0) or 5 * the GNU Lesser General Public License, as specified in the COPYING file. 6 * 7 * Changes are Copyright(C) 2007, 2008 by Nokia Corporation and/or its subsidiary(-ies), all rights reserved. 8 */ 9 #ifndef _lucene_index_FieldsWriter_ 10 #define _lucene_index_FieldsWriter_ 11 12 #if defined(_LUCENE_PRAGMA_ONCE) 13 # pragma once 14 #endif 15 16 #include <QtCore/QString> 17 18 #include "CLucene/document/Document.h" 19 #include "CLucene/store/Directory.h" 20 #include "CLucene/store/IndexOutput.h" 21 CL_NS_DEF(index)22CL_NS_DEF(index) 23 24 class FieldInfos; 25 26 class FieldsWriter : LUCENE_BASE 27 { 28 private: 29 FieldInfos* fieldInfos; 30 31 CL_NS(store)::IndexOutput* fieldsStream; 32 CL_NS(store)::IndexOutput* indexStream; 33 34 public: 35 LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_TOKENIZED = 0x1); 36 LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_BINARY = 0x2); 37 LUCENE_STATIC_CONSTANT(uint8_t, FIELD_IS_COMPRESSED = 0x4); 38 39 FieldsWriter(CL_NS(store)::Directory* d, const QString& segment, FieldInfos* fn); 40 ~FieldsWriter(); 41 42 void close(); 43 44 void addDocument(CL_NS(document)::Document* doc); 45 }; 46 47 CL_NS_END 48 49 #endif 50