00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef XAPIAN_INCLUDED_DOCUMENT_H
00026 #define XAPIAN_INCLUDED_DOCUMENT_H
00027
00028 #include <string>
00029
00030 #include <xapian/base.h>
00031 #include <xapian/types.h>
00032 #include <xapian/termiterator.h>
00033 #include <xapian/valueiterator.h>
00034 #include <xapian/visibility.h>
00035
00036 namespace Xapian {
00037
00038 class ValueIterator;
00039
00041 class XAPIAN_VISIBILITY_DEFAULT Document {
00042 public:
00043 class Internal;
00045 Xapian::Internal::RefCntPtr<Internal> internal;
00046
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
00076 std::string get_value(Xapian::valueno valueno) const;
00077
00081 void add_value(Xapian::valueno valueno, const std::string &value);
00082
00084 void remove_value(Xapian::valueno valueno);
00085
00087 void clear_values();
00088
00094 std::string get_data() const;
00095
00097 void set_data(const std::string &data);
00098
00113 void add_posting(const std::string & tname,
00114 Xapian::termpos tpos,
00115 Xapian::termcount wdfinc = 1);
00116
00126 void add_term(const std::string & tname, Xapian::termcount wdfinc = 1);
00127
00147 void remove_posting(const std::string & tname,
00148 Xapian::termpos tpos,
00149 Xapian::termcount wdfdec = 1);
00150
00158 void remove_term(const std::string & tname);
00159
00161 void clear_terms();
00162
00166 Xapian::termcount termlist_count() const;
00167
00169 TermIterator termlist_begin() const;
00170
00172 TermIterator termlist_end() const {
00173 return TermIterator(NULL);
00174 }
00175
00177 Xapian::termcount values_count() const;
00178
00180 ValueIterator values_begin() const;
00181
00183 ValueIterator values_end() const {
00184 return ValueIterator();
00185 }
00186
00196 docid get_docid() const;
00197
00205 std::string serialise() const;
00206
00209 static Document unserialise(const std::string &s);
00210
00212 std::string get_description() const;
00213 };
00214
00215 }
00216
00217 #endif // XAPIAN_INCLUDED_DOCUMENT_H