backends/quartz/quartz_values.h

Go to the documentation of this file.
00001 /* quartz_values.h: Values in quartz 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_QUARTZ_VALUES_H
00024 #define OM_HGUARD_QUARTZ_VALUES_H
00025 
00026 #include <map>
00027 #include <string>
00028 
00029 #include <xapian/types.h>
00030 #include <xapian/valueiterator.h>
00031 #include "btree.h"
00032 
00033 using namespace std;
00034 
00035 class QuartzValueTable : public Btree {
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:
00060         QuartzValueTable(string path_, bool readonly_)
00061             : Btree(path_ + "/value_", readonly_) { }
00062 
00065         void encode_values(string & s,
00066                            Xapian::ValueIterator it,
00067                            const Xapian::ValueIterator & end);
00068 
00070         void set_encoded_values(Xapian::docid did, const string & enc);
00071 
00076         void get_value(string & value, Xapian::docid did,
00077                        Xapian::valueno valueno) const;
00078 
00085         void get_all_values(map<Xapian::valueno, string> & values,
00086                             Xapian::docid did) const;
00087 
00093         void delete_all_values(Xapian::docid did);
00094 };
00095 
00096 #endif /* OM_HGUARD_QUARTZ_VALUES_H */

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