backends/flint/flint_values.h

Go to the documentation of this file.
00001 /* flint_values.h: Values in flint databases
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_VALUES_H
00024 #define OM_HGUARD_FLINT_VALUES_H
00025 
00026 #include <map>
00027 #include <string>
00028 
00029 #include <xapian/types.h>
00030 #include <xapian/valueiterator.h>
00031 #include "flint_table.h"
00032 
00033 using namespace std;
00034 
00035 class FlintValueTable : public FlintTable {
00036     private:
00040         static void unpack_entry(const char ** pos,
00041                                  const char * end,
00042                                  Xapian::valueno * this_value_no,
00043                                  string & this_value);
00044 
00045     public:
00058         FlintValueTable(string path_, bool readonly_)
00059             : FlintTable(path_ + "/value.", readonly_, DONT_COMPRESS, true) { }
00060 
00063         void encode_values(string & s,
00064                            Xapian::ValueIterator it,
00065                            const Xapian::ValueIterator & end);
00066 
00068         void set_encoded_values(Xapian::docid did, const string & enc);
00069 
00074         void get_value(string & value, Xapian::docid did,
00075                        Xapian::valueno valueno) const;
00076 
00083         void get_all_values(map<Xapian::valueno, string> & values,
00084                             Xapian::docid did) const;
00085 
00091         void delete_all_values(Xapian::docid did);
00092 };
00093 
00094 #endif /* OM_HGUARD_FLINT_VALUES_H */

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