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

CompoundFileWriter.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2014 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 public:
29 CompoundFileWriter(const DirectoryPtr& dir, const String& name, const CheckAbortPtr& checkAbort = CheckAbortPtr());
30 virtual ~CompoundFileWriter();
31
32 LUCENE_CLASS(CompoundFileWriter);
33
34 protected:
35 struct FileEntry {
37 String file;
38
40 int64_t directoryOffset;
41
43 int64_t dataOffset;
44 };
45
46 DirectoryWeakPtr _directory;
47 String fileName;
48 HashSet<String> ids;
49 Collection<FileEntry> entries;
50 bool merged;
51 CheckAbortPtr checkAbort;
52
53 public:
55 DirectoryPtr getDirectory();
56
58 String getName();
59
62 void addFile(const String& file);
63
67 void close();
68
69 protected:
72 void copyFile(const FileEntry& source, const IndexOutputPtr& os, ByteArray buffer);
73 };
74
75 }
76
77 #endif
Lucene::CompoundFileWriter::close
void close()
Merge files with the extensions added up to now. All files with these extensions are combined sequent...
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::CompoundFileWriter::merged
bool merged
Definition: CompoundFileWriter.h:50
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition: Collection.h:17
Lucene::CompoundFileWriter::FileEntry::directoryOffset
int64_t directoryOffset
temporary holder for the start of directory entry for this file
Definition: CompoundFileWriter.h:40
Lucene::CheckAbortPtr
boost::shared_ptr< CheckAbort > CheckAbortPtr
Definition: LuceneTypes.h:94
Lucene::CompoundFileWriter::fileName
String fileName
Definition: CompoundFileWriter.h:47
Lucene::DirectoryWeakPtr
boost::weak_ptr< Directory > DirectoryWeakPtr
Definition: LuceneTypes.h:489
Lucene::CompoundFileWriter
Combines multiple files into a single compound file. The file format: VInt fileCount {Directory} file...
Definition: CompoundFileWriter.h:27
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene::CompoundFileWriter::getDirectory
DirectoryPtr getDirectory()
Returns the directory of the compound file.
Lucene::CompoundFileWriter::addFile
void addFile(const String &file)
Add a source stream. file is the string by which the sub-stream will be known in the compound stream.
Lucene::HashSet< String >
Lucene::CompoundFileWriter::FileEntry::file
String file
source file
Definition: CompoundFileWriter.h:37
Lucene::CompoundFileWriter::getName
String getName()
Returns the name of the compound file.
Lucene::CompoundFileWriter::FileEntry
Definition: CompoundFileWriter.h:35
Lucene::CompoundFileWriter::ids
HashSet< String > ids
Definition: CompoundFileWriter.h:48
Lucene::CompoundFileWriter::copyFile
void copyFile(const FileEntry &source, const IndexOutputPtr &os, ByteArray buffer)
Copy the contents of the file with specified extension into the provided output stream....
Lucene::CompoundFileWriter::entries
Collection< FileEntry > entries
Definition: CompoundFileWriter.h:49
Lucene::CompoundFileWriter::CompoundFileWriter
CompoundFileWriter(const DirectoryPtr &dir, const String &name, const CheckAbortPtr &checkAbort=CheckAbortPtr())
Lucene::CompoundFileWriter::FileEntry::dataOffset
int64_t dataOffset
temporary holder for the start of this file's data section
Definition: CompoundFileWriter.h:43
Lucene::CompoundFileWriter::_directory
DirectoryWeakPtr _directory
Definition: CompoundFileWriter.h:46
Lucene::DirectoryPtr
boost::shared_ptr< Directory > DirectoryPtr
Definition: LuceneTypes.h:489
Lucene::CompoundFileWriter::~CompoundFileWriter
virtual ~CompoundFileWriter()
Lucene::CompoundFileWriter::checkAbort
CheckAbortPtr checkAbort
Definition: CompoundFileWriter.h:51
Lucene::IndexOutputPtr
boost::shared_ptr< IndexOutput > IndexOutputPtr
Definition: LuceneTypes.h:494
LuceneObject.h

clucene.sourceforge.net