Logo Search packages:      
Sourcecode: qt4-x11 version File versions

void SegmentTermEnum::seek ( const int64_t  pointer,
const int32_t  p,
Term *  t,
TermInfo *  ti 
)

Repositions term and termInfo within the enumeration

Definition at line 245 of file SegmentTermEnum.cpp.

References buffer, bufferLength, growBuffer(), position, and termInfo.

                                                                                              {
      //Func - Repositions term and termInfo within the enumeration
      //Pre  - pointer >= 0
      //       p >= 0 and contains the new position within the enumeration
      //       t is a valid reference to a Term and is the new current term in the enumeration
      //       ti is a valid reference to a TermInfo and is corresponding TermInfo form the new
      //       current Term
      //Post - term and terminfo have been repositioned within the enumeration

            //Reset the IndexInput input to pointer
            input->seek(pointer);
            //Assign the new position
            position = p;

            //finalize the current term
            if ( _term == NULL || _term->__cl_refcount > 1 ){
                  _CLDECDELETE(_term);
                  //Get a pointer from t and increase the reference counter of t
                  _term = _CLNEW Term; //cannot use reference, because TermInfosReader uses non ref-counted array
            }
            _term->set(t,t->text());

            //finalize prev
            _CLDECDELETE(prev);

            //Change the current termInfo so it matches the new current term
            termInfo->set(ti);

            //Have the buffer grown if needed
            if ( bufferLength <= _term->textLength() )
                  growBuffer(_term->textLength() );           // copy term text into buffer
            else
                  _tcsncpy(buffer,_term->text(),bufferLength); //just copy the buffer
      }


Generated by  Doxygen 1.6.0   Back to index