00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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 #include <xapian/visibility.h>
00033
00034 namespace Xapian {
00035
00036 class ValueIterator;
00037
00039 class XAPIAN_VISIBILITY_DEFAULT Document {
00040 public:
00041 class Internal;
00043 Xapian::Internal::RefCntPtr<Internal> internal;
00044
00049 explicit Document(Internal *internal_);
00050
00054 Document(const Document &other);
00055
00059 void operator=(const Document &other);
00060
00062 Document();
00063
00065 ~Document();
00066
00074 std::string get_value(Xapian::valueno valueno) const;
00075
00079 void add_value(Xapian::valueno valueno, const std::string &value);
00080
00082 void remove_value(Xapian::valueno valueno);
00083
00085 void clear_values();
00086
00092 std::string get_data() const;
00093
00095 void set_data(const std::string &data);
00096
00111 void add_posting(const std::string & tname,
00112 Xapian::termpos tpos,
00113 Xapian::termcount wdfinc = 1);
00114
00124 void add_term(const std::string & tname, Xapian::termcount wdfinc = 1);
00125
00145 void remove_posting(const std::string & tname,
00146 Xapian::termpos tpos,
00147 Xapian::termcount wdfdec = 1);
00148
00156 void remove_term(const std::string & tname);
00157
00159 void clear_terms();
00160
00164 Xapian::termcount termlist_count() const;
00165
00167 TermIterator termlist_begin() const;
00168
00170 TermIterator termlist_end() const {
00171 return TermIterator(NULL);
00172 }
00173
00175 Xapian::termcount values_count() const;
00176
00178 ValueIterator values_begin() const;
00179
00181 ValueIterator values_end() const;
00182
00192 docid get_docid() const;
00193
00195 std::string get_description() const;
00196 };
00197
00198 }
00199
00200 #endif // XAPIAN_INCLUDED_DOCUMENT_H