lucene::search::Searcher* getIndexSearcher() { if ( !searcher ) { closeWriter(); searcher = _CLNEW lucene::search::IndexSearcher( indexDir ); } return searcher; }
void BinaryWriterAppender::setWriter(QDataStream *pDataStream) { QMutexLocker locker(&mObjectGuard); closeWriter(); mpWriter = pDataStream; writeHeader(); }
void BinaryWriterAppender::close() { QMutexLocker locker(&mObjectGuard); if (isClosed()) return; AppenderSkeleton::close(); closeWriter(); }
lucene::index::IndexReader* getIndexReader() { if ( !indexReader ) { try { closeWriter(); indexReader = lucene::index::IndexReader::open( indexDir, false ); } catch (CLuceneError& err) { qDebug() << "(Soprano::Index::CLuceneIndex) could not create reader " << err.what(); throw err; } } return indexReader; }
/* ~TextFileWriter - This destructor makes sure the text stream is closed before destroying it and the file name pointers. */ TextFileWriter::~TextFileWriter() { closeWriter(); }