Lucene++ - a full-featured, c++ search engine
API Documentation

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CompoundFileWriter.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6
7 #ifndef COMPOUNDFILEWRITER_H
8 #define COMPOUNDFILEWRITER_H
9
10 #include "LuceneObject.h"
11
12 namespace Lucene
13 {
27 class CompoundFileWriter : public LuceneObject
28 {
29 public:
30 CompoundFileWriter(DirectoryPtr dir, const String& name, CheckAbortPtr checkAbort = CheckAbortPtr());
31 virtual ~CompoundFileWriter();
32
33 LUCENE_CLASS(CompoundFileWriter);
34
35 protected:
36 struct FileEntry
37 {
39 String file;
40
42 int64_t directoryOffset;
43
45 int64_t dataOffset;
46 };
47
48 DirectoryWeakPtr _directory;
49 String fileName;
50 HashSet<String> ids;
51 Collection<FileEntry> entries;
52 bool merged;
53 CheckAbortPtr checkAbort;
54
55 public:
57 DirectoryPtr getDirectory();
58
60 String getName();
61
64 void addFile(const String& file);
65
69 void close();
70
71 protected:
74 void copyFile(const FileEntry& source, IndexOutputPtr os, ByteArray buffer);
75 };
76 }
77
78 #endif

clucene.sourceforge.net