Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

/include/xapian/document.h

Go to the documentation of this file.
00001 
00004 /* ----START-LICENCE----
00005  * Copyright 1999,2000,2001 BrightStation PLC
00006  * Copyright 2002 Ananova Ltd
00007  * Copyright 2002,2003,2004 Olly Betts
00008  *
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU General Public License as
00011  * published by the Free Software Foundation; either version 2 of the
00012  * License, or (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00022  * USA
00023  * -----END-LICENCE-----
00024  */
00025 
00026 #ifndef XAPIAN_INCLUDED_DOCUMENT_H
00027 #define XAPIAN_INCLUDED_DOCUMENT_H
00028 
00029 #include <string>
00030 
00031 #include <xapian/base.h>
00032 #include <xapian/types.h>
00033 
00034 namespace Xapian {
00035 
00036 class TermIterator;
00037 class ValueIterator;
00038 
00040 class Document {
00041     public:
00042         class Internal;
00044         Xapian::Internal::RefCntPtr<Internal> internal;
00045 
00046     public:
00051         explicit Document(Internal *internal_);
00052 
00056         Document(const Document &other);
00057 
00061         void operator=(const Document &other);
00062 
00064         Document();
00065 
00067         ~Document();
00068 
00070         std::string get_value(Xapian::valueno value) const;
00071 
00075         void add_value(Xapian::valueno valueno, const std::string &value);
00076 
00078         void remove_value(Xapian::valueno valueno);
00079 
00081         void clear_values();
00082 
00088         std::string get_data() const;
00089 
00091         void set_data(const std::string &data);
00092 
00107         void add_posting(const std::string & tname,
00108                          Xapian::termpos tpos,
00109                          Xapian::termcount wdfinc = 1);
00110 
00121         void add_term(const std::string & tname, Xapian::termcount wdfinc = 1);
00122 
00127         void add_term_nopos(const std::string & term,
00128                             Xapian::termcount wdfinc = 1) {
00129             add_term(term, wdfinc);
00130         }
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 
00177         Xapian::termcount values_count() const;
00178 
00180         ValueIterator values_begin() const;
00181 
00183         ValueIterator values_end() const;
00184 
00189         std::string get_description() const;
00190 };
00191 
00192 }
00193 
00194 #endif // XAPIAN_INCLUDED_DOCUMENT_H

Documentation for Xapian (version 0.8.2).
Generated on 13 Sep 2004 by Doxygen 1.2.15.