diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-09-12 22:29:32 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-09-13 20:17:44 +0200 |
commit | 7d0a7adede5166cf64ceb7b7826d2817d9f86e7d (patch) | |
tree | 705233a6ffdf0cc41a5906d5255798695ff1d601 /3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp | |
parent | 5a818d1e1e7f63c30ea00753397f5c9831c6c0d6 (diff) |
Get assistant to compile against refactor
Give the source code a somewhat saner structure while
I'm at it.
Change-Id: I99766405debe231a0562dd623ba1d17f19333656
Reviewed-on: http://codereview.qt-project.org/4829
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to '3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp')
-rw-r--r-- | 3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp b/3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp deleted file mode 100644 index e481838e9..000000000 --- a/3rdparty/clucene/src/CLucene/index/SegmentTermPositions.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/*------------------------------------------------------------------------------ -* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team -* -* Distributable under the terms of either the Apache License (Version 2.0) or -* the GNU Lesser General Public License, as specified in the COPYING file. -------------------------------------------------------------------------------*/ -#include "CLucene/StdHeader.h" -#include "SegmentHeader.h" - -#include "Terms.h" - -CL_NS_USE(util) -CL_NS_DEF(index) - -SegmentTermPositions::SegmentTermPositions(const SegmentReader* _parent): - SegmentTermDocs(_parent){ -//Func - Constructor -//Pre - Parent != NULL -//Post - The instance has been created - - CND_PRECONDITION(_parent != NULL, "Parent is NULL"); - - proxStream = _parent->proxStream->clone(); - - CND_CONDITION(proxStream != NULL,"proxStream is NULL"); - - position = 0; - proxCount = 0; -} - -SegmentTermPositions::~SegmentTermPositions() { -//Func - Destructor -//Pre - true -//Post - The intance has been closed - close(); -} - -TermDocs* SegmentTermPositions::__asTermDocs(){ - return (TermDocs*) this; -} -TermPositions* SegmentTermPositions::__asTermPositions(){ - return (TermPositions*) this; -} - -void SegmentTermPositions::seek(const TermInfo* ti) { - SegmentTermDocs::seek(ti); - if (ti != NULL) - proxStream->seek(ti->proxPointer); - proxCount = 0; -} - -void SegmentTermPositions::close() { -//Func - Frees the resources -//Pre - true -//Post - The resources have been freed - - SegmentTermDocs::close(); - //Check if proxStream still exists - if(proxStream){ - proxStream->close(); - _CLDELETE( proxStream ); - } -} - -int32_t SegmentTermPositions::nextPosition() { - /* DSR:CL_BUG: Should raise exception if proxCount == 0 at the - ** beginning of this method, as in - ** if (--proxCount == 0) throw ...; - ** The JavaDocs for TermPositions.nextPosition declare this constraint, - ** but CLucene doesn't enforce it. */ - proxCount--; - return position += proxStream->readVInt(); -} - -bool SegmentTermPositions::next() { - for (int32_t f = proxCount; f > 0; f--) // skip unread positions - proxStream->readVInt(); - - if (SegmentTermDocs::next()) { // run super - proxCount = _freq; // note frequency - position = 0; // reset position - return true; - } - return false; -} - -int32_t SegmentTermPositions::read(int32_t* docs, int32_t* freqs, int32_t length) { - _CLTHROWA(CL_ERR_InvalidState,"TermPositions does not support processing multiple documents in one call. Use TermDocs instead."); -} - -void SegmentTermPositions::skippingDoc() { - for (int32_t f = _freq; f > 0; f--) // skip all positions - proxStream->readVInt(); -} - -void SegmentTermPositions::skipProx(int64_t proxPointer){ - proxStream->seek(proxPointer); - proxCount = 0; -} - -CL_NS_END |