backends/flint/flint_record.h

Go to the documentation of this file.
00001 /* flint_record.h: Records in flint databases
00002  *
00003  * Copyright 1999,2000,2001 BrightStation PLC
00004  * Copyright 2002 Ananova Ltd
00005  * Copyright 2002,2003,2004,2005,2007 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_RECORD_H
00024 #define OM_HGUARD_FLINT_RECORD_H
00025 
00026 #include <string>
00027 
00028 #include <xapian/types.h>
00029 #include "flint_types.h"
00030 #include "flint_table.h"
00031 
00032 using namespace std;
00033 
00036 class FlintRecordTable : public FlintTable {
00037     public:
00050         FlintRecordTable(string path_, bool readonly_)
00051             : FlintTable(path_ + "/record.", readonly_, Z_DEFAULT_STRATEGY) { }
00052 
00055         string get_record(Xapian::docid did) const;
00056 
00059         Xapian::doccount get_doccount() const;
00060 
00061         /* Add a new record to the table, or replace an existing record.
00062          *
00063          * @param did   The document ID to use.
00064          */
00065         void replace_record(const string & data, Xapian::docid did);
00066 
00069         void delete_record(Xapian::docid did);
00070 };
00071 
00072 #endif /* OM_HGUARD_FLINT_RECORD_H */

Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.