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


lucene::index::CompoundFileWriter Class Reference

Combines multiple files into a single compound file. More...

#include <CompoundFile.h>

Inheritance diagram for lucene::index::CompoundFileWriter:
lucene::debug::LuceneBase

List of all members.

Classes

class  WriterFileEntry

Public Member Functions

 CompoundFileWriter (lucene::store::Directory *dir, const char *name)
 Create the compound stream in the specified file.
 ~CompoundFileWriter ()
lucene::store::DirectorygetDirectory ()
 Returns the directory of the compound file.
const char * getName () const
void addFile (const char *file)
 Add a source stream.
void close ()
 Merge files with the extensions added up to now.

Detailed Description

Combines multiple files into a single compound file.

The file format:

The fileCount integer indicates how many files are contained in this compound file. The {directory} that follows has that many entries. Each directory entry contains an encoding identifier, an int64_t pointer to the start of this file's data section, and a UTF String with that file's extension.


Constructor & Destructor Documentation

lucene::index::CompoundFileWriter::CompoundFileWriter ( lucene::store::Directory dir,
const char *  name 
)

Create the compound stream in the specified file.

The file name is the entire name (no extensions are added).

lucene::index::CompoundFileWriter::~CompoundFileWriter (  ) 

Member Function Documentation

void lucene::index::CompoundFileWriter::addFile ( const char *  file  ) 

Add a source stream.

file is the string by which the sub-stream will be known in the compound stream.

Exceptions:
IllegalStateException if this writer is closed
NullPointerException if file is null
IllegalArgumentException if a file with the same name has been added already
void lucene::index::CompoundFileWriter::close (  ) 

Merge files with the extensions added up to now.

All files with these extensions are combined sequentially into the compound stream. After successful merge, the source files

Exceptions:
IllegalStateException if close() had been called before or if no file has been added to this object are deleted.
lucene:: store ::Directory* lucene::index::CompoundFileWriter::getDirectory (  ) 

Returns the directory of the compound file.

const char* lucene::index::CompoundFileWriter::getName (  )  const

The documentation for this class was generated from the following file:

clucene.sourceforge.net