LCOV - code coverage report
Current view: top level - backends/brass - brass_alldocspostlist.cc (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core r Lines: 7 20 35.0 %
Date: 2011-08-21 Functions: 3 8 37.5 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /** @file brass_alldocspostlist.cc
       2                 :            :  * @brief A PostList which iterates over all documents in a BrassDatabase.
       3                 :            :  */
       4                 :            : /* Copyright (C) 2006,2007,2008,2009 Olly Betts
       5                 :            :  * Copyright (C) 2008 Lemur Consulting Ltd
       6                 :            :  *
       7                 :            :  * This program is free software; you can redistribute it and/or modify
       8                 :            :  * it under the terms of the GNU General Public License as published by
       9                 :            :  * the Free Software Foundation; either version 2 of the License, or
      10                 :            :  * (at your option) any later version.
      11                 :            :  *
      12                 :            :  * This program is distributed in the hope that it will be useful,
      13                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      14                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      15                 :            :  * GNU General Public License for more details.
      16                 :            :  *
      17                 :            :  * You should have received a copy of the GNU General Public License
      18                 :            :  * along with this program; if not, write to the Free Software
      19                 :            :  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
      20                 :            :  */
      21                 :            : 
      22                 :            : #include <config.h>
      23                 :            : #include "brass_alldocspostlist.h"
      24                 :            : 
      25                 :            : #include <string>
      26                 :            : 
      27                 :            : #include "brass_database.h"
      28                 :            : #include "debuglog.h"
      29                 :            : 
      30                 :            : #include "str.h"
      31                 :            : 
      32                 :            : using namespace std;
      33                 :            : 
      34                 :        229 : BrassAllDocsPostList::BrassAllDocsPostList(Xapian::Internal::RefCntPtr<const BrassDatabase> db_,
      35                 :            :                                            Xapian::doccount doccount_)
      36                 :            :         : BrassPostList(db_, string(), true),
      37                 :        229 :           doccount(doccount_)
      38                 :            : {
      39                 :            :     LOGCALL_CTOR(DB, "BrassAllDocsPostList", db_.get() | doccount_);
      40                 :        229 : }
      41                 :            : 
      42                 :            : Xapian::doccount
      43                 :          0 : BrassAllDocsPostList::get_termfreq() const
      44                 :            : {
      45                 :            :     LOGCALL(DB, Xapian::doccount, "BrassAllDocsPostList::get_termfreq", NO_ARGS);
      46                 :          0 :     RETURN(doccount);
      47                 :            : }
      48                 :            : 
      49                 :            : Xapian::termcount
      50                 :          7 : BrassAllDocsPostList::get_doclength() const
      51                 :            : {
      52                 :            :     LOGCALL(DB, Xapian::termcount, "BrassAllDocsPostList::get_doclength", NO_ARGS);
      53                 :            : 
      54                 :          7 :     RETURN(BrassPostList::get_wdf());
      55                 :            : }
      56                 :            : 
      57                 :            : Xapian::termcount
      58                 :       2083 : BrassAllDocsPostList::get_wdf() const
      59                 :            : {
      60                 :            :     LOGCALL(DB, Xapian::termcount, "BrassAllDocsPostList::get_wdf", NO_ARGS);
      61                 :            :     AssertParanoid(!at_end());
      62                 :       2083 :     RETURN(1);
      63                 :            : }
      64                 :            : 
      65                 :            : PositionList *
      66                 :          0 : BrassAllDocsPostList::read_position_list()
      67                 :            : {
      68                 :            :     LOGCALL(DB, Xapian::termcount, "BrassAllDocsPostList::read_position_list", NO_ARGS);
      69                 :          0 :     throw Xapian::InvalidOperationError("BrassAllDocsPostList::read_position_list() not meaningful");
      70                 :            : }
      71                 :            : 
      72                 :            : PositionList *
      73                 :          0 : BrassAllDocsPostList::open_position_list() const
      74                 :            : {
      75                 :            :     LOGCALL(DB, Xapian::termcount, "BrassAllDocsPostList::open_position_list", NO_ARGS);
      76                 :          0 :     throw Xapian::InvalidOperationError("BrassAllDocsPostList::open_position_list() not meaningful");
      77                 :            : }
      78                 :            : 
      79                 :            : string
      80                 :          0 : BrassAllDocsPostList::get_description() const
      81                 :            : {
      82                 :          0 :     string desc = "BrassAllDocsPostList(did=";
      83                 :          0 :     desc += str(get_docid());
      84                 :          0 :     desc += ",doccount=";
      85                 :          0 :     desc += str(doccount);
      86                 :          0 :     desc += ')';
      87                 :          0 :     return desc;
      88                 :            : }

Generated by: LCOV version 1.8