SegmentMerger::SegmentMerger(IndexWriter* writer, const char* name){ //Func - Constructor //Pre - dir holds a valid reference to a Directory // name != NULL //Post - Instance has been created CND_PRECONDITION(name != NULL, "name is NULL"); freqOutput = NULL; proxOutput = NULL; termInfosWriter = NULL; queue = NULL; fieldInfos = NULL; useCompoundFile = writer->getUseCompoundFile(); skipBuffer = _CLNEW CL_NS(store)::RAMIndexOutput(); segment = STRDUP_AtoA(name); directory = writer->getDirectory(); termIndexInterval= writer->getTermIndexInterval(); lastSkipDoc=0; lastSkipFreqPointer=0; lastSkipProxPointer=0; skipInterval=0; }
CLuceneError::CLuceneError(int num, const char* str, bool ownstr) { error_number = num; _awhat=STRDUP_AtoA(str); _twhat=NULL; if ( ownstr ) _CLDELETE_CaARRAY(str); }
CLuceneError::CLuceneError(const CLuceneError& clone) { this->error_number = clone.error_number; this->_awhat = NULL; this->_twhat = NULL; if ( clone._awhat != NULL ) this->_awhat = STRDUP_AtoA(clone._awhat); if ( clone._twhat != NULL ) this->_twhat = STRDUP_TtoT(clone._twhat); }
IndexFileDeleter::RefCount* IndexFileDeleter::getRefCount(const char* fileName) { RefCount* rc; RefCountsType::iterator itr = refCounts.find((char*)fileName); if (itr == refCounts.end()) { rc = _CLNEW RefCount(); refCounts.put( STRDUP_AtoA(fileName), rc); } else { rc = itr->second; } return rc; }
FSLock::FSLock( const char* _lockDir, const char* name, int filemode ) { if ( filemode <= 0 ) this->filemode = 0644; //must do this or file will be created Read only else this->filemode = filemode; this->lockFile = _CL_NEWARRAY(char,CL_MAX_PATH); this->lockDir = STRDUP_AtoA(_lockDir); strcpy(lockFile,_lockDir); strcat(lockFile,PATH_DELIMITERA); strcat(lockFile,name); }
RAMDirectory::RAMLock::RAMLock(const char* name, RAMDirectory* dir): directory(dir) { fname = STRDUP_AtoA(name); }