00001 /* flint_document.h: Document from a Flint Database 00002 * 00003 * Copyright 1999,2000,2001 BrightStation PLC 00004 * Copyright 2002 Ananova Ltd 00005 * Copyright 2002,2003,2004,2008 Olly Betts 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License as 00009 * published by the Free Software Foundation; either version 2 of the 00010 * License, or (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 00020 * USA 00021 */ 00022 00023 #ifndef OM_HGUARD_FLINT_DOCUMENT_H 00024 #define OM_HGUARD_FLINT_DOCUMENT_H 00025 00026 #include <xapian/base.h> 00027 #include "document.h" 00028 00029 class FlintDatabase; 00030 class FlintValueTable; 00031 class FlintRecordTable; 00032 00034 class FlintDocument : public Xapian::Document::Internal { 00035 friend class FlintDatabase; 00036 friend class FlintWritableDatabase; 00037 private: 00038 Xapian::Internal::RefCntPtr<const Xapian::Database::Internal> database; 00039 00040 const FlintValueTable *value_table; 00041 const FlintRecordTable *record_table; 00042 00043 FlintDocument(Xapian::Internal::RefCntPtr<const Xapian::Database::Internal> database_, 00044 const FlintValueTable *value_table_, 00045 const FlintRecordTable *record_table_, 00046 Xapian::docid did_, bool lazy); 00047 00048 // Prevent copying 00049 FlintDocument(const FlintDocument &); 00050 FlintDocument & operator = (const FlintDocument &); 00051 public: 00052 string do_get_value(Xapian::valueno slot) const; 00053 void do_get_all_values(map<Xapian::valueno, string> & values_) const; 00054 string do_get_data() const; 00055 }; 00056 00057 #endif /* OM_HGUARD_FLINT_DOCUMENT_H */