include/xapian/document.h

Go to the documentation of this file.
00001 
00004 /* Copyright 1999,2000,2001 BrightStation PLC
00005  * Copyright 2002 Ananova Ltd
00006  * Copyright 2002,2003,2004,2006 Olly Betts
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License as
00010  * published by the Free Software Foundation; either version 2 of the
00011  * License, or (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00021  * USA
00022  */
00023 
00024 #ifndef XAPIAN_INCLUDED_DOCUMENT_H
00025 #define XAPIAN_INCLUDED_DOCUMENT_H
00026 
00027 #include <string>
00028 
00029 #include <xapian/base.h>
00030 #include <xapian/types.h>
00031 #include <xapian/termiterator.h>
00032 
00033 namespace Xapian {
00034 
00035 class ValueIterator;
00036 
00038 class Document {
00039     public:
00040         class Internal;
00042         Xapian::Internal::RefCntPtr<Internal> internal;
00043 
00048         explicit Document(Internal *internal_);
00049 
00053         Document(const Document &other);
00054 
00058         void operator=(const Document &other);
00059 
00061         Document();
00062 
00064         ~Document();
00065 
00073         std::string get_value(Xapian::valueno value) const;
00074 
00078         void add_value(Xapian::valueno valueno, const std::string &value);
00079 
00081         void remove_value(Xapian::valueno valueno);
00082 
00084         void clear_values();
00085 
00091         std::string get_data() const;
00092 
00094         void set_data(const std::string &data);
00095 
00110         void add_posting(const std::string & tname,
00111                          Xapian::termpos tpos,
00112                          Xapian::termcount wdfinc = 1);
00113 
00123         void add_term(const std::string & tname, Xapian::termcount wdfinc = 1);
00124 
00130         XAPIAN_DEPRECATED(void add_term_nopos(const std::string & term, Xapian::termcount wdfinc = 1));
00131 
00151         void remove_posting(const std::string & tname,
00152                             Xapian::termpos tpos,
00153                             Xapian::termcount wdfdec = 1);
00154 
00162         void remove_term(const std::string & tname);
00163 
00165         void clear_terms();
00166 
00168         Xapian::termcount termlist_count() const;
00169 
00171         TermIterator termlist_begin() const;
00172 
00174         TermIterator termlist_end() const {
00175             return TermIterator(NULL);
00176         }
00177 
00179         Xapian::termcount values_count() const;
00180 
00182         ValueIterator values_begin() const;
00183 
00185         ValueIterator values_end() const;
00186 
00191         std::string get_description() const;
00192 };
00193 
00194 }
00195 
00196 #endif // XAPIAN_INCLUDED_DOCUMENT_H

Documentation for Xapian (version 0.9.10).
Generated on 6 Mar 2007 by Doxygen 1.4.6.