xapian-core  1.4.25
chert_record.h
Go to the documentation of this file.
1 
4 /* Copyright 1999,2000,2001 BrightStation PLC
5  * Copyright 2002 Ananova Ltd
6  * Copyright 2002,2003,2004,2005,2007,2008 Olly Betts
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
21  * USA
22  */
23 
24 #ifndef OM_HGUARD_CHERT_RECORD_H
25 #define OM_HGUARD_CHERT_RECORD_H
26 
27 #include <string>
28 
29 #include <xapian/types.h>
30 #include "chert_types.h"
31 #include "chert_table.h"
32 
33 using namespace std;
34 
37 class ChertRecordTable : public ChertTable {
38  public:
51  ChertRecordTable(const string & path_, bool readonly_)
52  : ChertTable("record", path_ + "/record.", readonly_, Z_DEFAULT_STRATEGY) { }
53 
56  string get_record(Xapian::docid did) const;
57 
60  Xapian::doccount get_doccount() const;
61 
62  /* Add a new record to the table, or replace an existing record.
63  *
64  * @param did The document ID to use.
65  */
66  void replace_record(const string & data, Xapian::docid did);
67 
70  void delete_record(Xapian::docid did);
71 
72  void readahead_for_record(Xapian::docid did) const;
73 };
74 
75 #endif /* OM_HGUARD_CHERT_RECORD_H */
typedefs for Xapian
Class managing a Btree table in a Chert database.
Definition: chert_table.h:347
A record in a chert database.
Definition: chert_record.h:37
STL namespace.
Types used by chert backend and the Btree manager.
Btree implementation.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
ChertRecordTable(const string &path_, bool readonly_)
Create a new table object.
Definition: chert_record.h:51
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52