| 1 | /** @file chert_alldocspostlist.cc |
| 2 | * @brief A PostList which iterates over all documents in a ChertDatabase. |
| 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>cxx . . $ `<file>/config.h`/ |
| 23 | #include "chert_alldocspostlist.h"cxx . . $ `<file>/backends/chert/chert_alldocspostlist.h`/ |
| 24 | |
| 25 | #include <string> |
| 26 | |
| 27 | #include "chert_database.h"cxx . . $ `<file>/backends/chert/chert_database.h`/ |
| 28 | #include "debuglog.h"cxx . . $ `<file>/common/debuglog.h`/ |
| 29 | |
| 30 | #include "str.h"cxx . . $ `<file>/common/str.h`/ |
| 31 | |
| 32 | using namespace std; |
| 33 | using Xapiancxx . . $ Xapian/::Internalcxx . . $ Xapian/Internal/::intrusive_ptrcxx . . $ intrusive_ptr#; |
| 34 | |
| 35 | ChertAllDocsPostListcxx . . $ ChertAllDocsPostList#::ChertAllDocsPostListcxx . . $ ChertAllDocsPostList#ChertAllDocsPostList(9b6d35d3d4a1f026).(intrusive_ptrcxx . . $ intrusive_ptr#<const ChertDatabasecxx . . $ ChertDatabase#> db_, |
| 36 | Xapiancxx . . $ Xapian/::doccountcxx . . $ Xapian/doccount# doccount_) |
| 37 | : ChertPostListcxx . . $ ChertPostList#ChertPostList(200d281fb4e89bd).(db_cxx . . $ Xapian/Internal/intrusive_ptr#intrusive_ptr(1f1e08aa4d15111e)., stringcxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).(), true), |
| 38 | doccountcxx . . $ ChertAllDocsPostList#doccount.(doccount_) |
| 39 | { |
| 40 | LOGCALL_CTORcxx . . $ `common/debuglog.h:489:9`!(DB, "ChertAllDocsPostList", db_.get() | doccount_); |
| 41 | } |
| 42 | |
| 43 | Xapiancxx . . $ Xapian/::doccountcxx . . $ Xapian/doccount# |
| 44 | ChertAllDocsPostListcxx . . $ ChertAllDocsPostList#::get_termfreqcxx . . $ ChertAllDocsPostList#get_termfreq(ddd8539a2fcdd4ce).() const |
| 45 | { |
| 46 | LOGCALLcxx . . $ `common/debuglog.h:487:9`!(DB, Xapian::doccount, "ChertAllDocsPostList::get_termfreq", NO_ARGS); |
| 47 | RETURNcxx . . $ `common/debuglog.h:493:9`!(doccount); |
| 48 | } |
| 49 | |
| 50 | Xapiancxx . . $ Xapian/::termcountcxx . . $ Xapian/termcount# |
| 51 | ChertAllDocsPostListcxx . . $ ChertAllDocsPostList#::get_doclengthcxx . . $ ChertAllDocsPostList#get_doclength(ddd8539a2fcdd4ce).() const |
| 52 | { |
| 53 | LOGCALLcxx . . $ `common/debuglog.h:487:9`!(DB, Xapian::termcount, "ChertAllDocsPostList::get_doclength", NO_ARGS); |
| 54 | |
| 55 | RETURNcxx . . $ `common/debuglog.h:493:9`!(ChertPostList::get_wdf()); |
| 56 | } |
| 57 | |
| 58 | Xapiancxx . . $ Xapian/::termcountcxx . . $ Xapian/termcount# |
| 59 | ChertAllDocsPostListcxx . . $ ChertAllDocsPostList#::get_wdfcxx . . $ ChertAllDocsPostList#get_wdf(ddd8539a2fcdd4ce).() const |
| 60 | { |
| 61 | LOGCALLcxx . . $ `common/debuglog.h:487:9`!(DB, Xapian::termcount, "ChertAllDocsPostList::get_wdf", NO_ARGS); |
| 62 | AssertParanoidcxx . . $ `common/omassert.h:129:10`!(!at_end()); |
| 63 | RETURNcxx . . $ `common/debuglog.h:493:9`!(1); |
| 64 | } |
| 65 | |
| 66 | PositionListcxx . . $ PositionList# * |
| 67 | ChertAllDocsPostListcxx . . $ ChertAllDocsPostList#::read_position_listcxx . . $ ChertAllDocsPostList#read_position_list(66f5e7e330086f4e).() |
| 68 | { |
| 69 | LOGCALLcxx . . $ `common/debuglog.h:487:9`!(DB, PositionList *, "ChertAllDocsPostList::read_position_list", NO_ARGS); |
| 70 | throw Xapiancxx . . $ Xapian/::InvalidOperationErrorcxx . . $ Xapian/InvalidOperationError#("ChertAllDocsPostList::read_position_list() not meaningful"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 71 | } |
| 72 | |
| 73 | PositionListcxx . . $ PositionList# * |
| 74 | ChertAllDocsPostListcxx . . $ ChertAllDocsPostList#::open_position_listcxx . . $ ChertAllDocsPostList#open_position_list(898d6462a72bf073).() const |
| 75 | { |
| 76 | LOGCALLcxx . . $ `common/debuglog.h:487:9`!(DB, PositionList *, "ChertAllDocsPostList::open_position_list", NO_ARGS); |
| 77 | throw Xapiancxx . . $ Xapian/::InvalidOperationErrorcxx . . $ Xapian/InvalidOperationError#("ChertAllDocsPostList::open_position_list() not meaningful"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).); |
| 78 | } |
| 79 | |
| 80 | stringcxx . . $ string# |
| 81 | ChertAllDocsPostListcxx . . $ ChertAllDocsPostList#::get_descriptioncxx . . $ ChertAllDocsPostList#get_description(219584694fe2b248).() const |
| 82 | { |
| 83 | stringcxx . . $ string# desc = "ChertAllDocsPostList(did="cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 84 | desc +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). strcxx . . $ str(8297fed3afd4179b).(get_docidcxx . . $ ChertPostList#get_docid(ddd8539a2fcdd4ce).()); |
| 85 | desc +=cxx . . $ std/__cxx11/basic_string#`operator+=`(978ca1133b5f6e74). ",doccount="; |
| 86 | desc +=cxx . . $ std/__cxx11/basic_string#`operator+=`(c0b47be1fddc0e75). strcxx . . $ str(8297fed3afd4179b).(doccountcxx . . $ ChertAllDocsPostList#doccount.); |
| 87 | desc +=cxx . . $ std/__cxx11/basic_string#`operator+=`(63cc1ae870623930). ')'; |
| 88 | return desccxx . . $ std/__cxx11/basic_string#basic_string(8f3aaafa33d05d0b).; |
| 89 | } |