00001 00004 /* Copyright (C) 2005,2007,2008,2009 Olly Betts 00005 * Copyright (C) 2008 Lemur Consulting Ltd 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 #ifndef XAPIAN_INCLUDED_BRASS_METADATA_H 00023 #define XAPIAN_INCLUDED_BRASS_METADATA_H 00024 00025 #include <xapian/base.h> 00026 #include <xapian/database.h> 00027 #include <xapian/types.h> 00028 00029 #include "alltermslist.h" 00030 #include "brass_table.h" 00031 #include "termlist.h" 00032 00033 #include <string> 00034 00035 class BrassCursor; 00036 00037 class BrassMetadataTermList : public AllTermsList { 00039 BrassMetadataTermList(const BrassMetadataTermList &); 00040 00042 void operator=(const BrassMetadataTermList &); 00043 00045 Xapian::Internal::RefCntPtr<const Xapian::Database::Internal> database; 00046 00049 BrassCursor * cursor; 00050 00053 std::string prefix; 00054 00055 public: 00056 BrassMetadataTermList(Xapian::Internal::RefCntPtr<const Xapian::Database::Internal> database_, 00057 BrassCursor * cursor_, const std::string &prefix_); 00058 00059 ~BrassMetadataTermList(); 00060 00066 std::string get_termname() const; 00067 00072 Xapian::doccount get_termfreq() const; 00073 00078 Xapian::termcount get_collection_freq() const; 00079 00081 TermList * next(); 00082 00084 TermList * skip_to(const std::string &key); 00085 00087 bool at_end() const; 00088 }; 00089 00090 #endif // XAPIAN_INCLUDED_BRASS_METADATA_H