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
00052 class XAPIAN_VISIBILITY_DEFAULT Document {
00053 public:
00054 class Internal;
00056 Xapian::Internal::RefCntPtr<Internal> internal;
00057
00062 explicit Document(Internal *internal_);
00063
00067 Document(const Document &other);
00068
00072 void operator=(const Document &other);
00073
00075 Document();
00076
00078 ~Document();
00079
00087 std::string get_value(Xapian::valueno valueno) const;
00088
00095 void add_value(Xapian::valueno valueno, const std::string &value);
00096
00098 void remove_value(Xapian::valueno valueno);
00099
00101 void clear_values();
00102
00108 std::string get_data() const;
00109
00111 void set_data(const std::string &data);
00112
00127 void add_posting(const std::string & tname,
00128 Xapian::termpos tpos,
00129 Xapian::termcount wdfinc = 1);
00130
00140 void add_term(const std::string & tname, Xapian::termcount wdfinc = 1);
00141
00158 void add_boolean_term(const std::string & term) { add_term(term, 0); }
00159
00179 void remove_posting(const std::string & tname,
00180 Xapian::termpos tpos,
00181 Xapian::termcount wdfdec = 1);
00182
00190 void remove_term(const std::string & tname);
00191
00193 void clear_terms();
00194
00198 Xapian::termcount termlist_count() const;
00199
00201 TermIterator termlist_begin() const;
00202
00204 TermIterator termlist_end() const {
00205 return TermIterator(NULL);
00206 }
00207
00209 Xapian::termcount values_count() const;
00210
00212 ValueIterator values_begin() const;
00213
00215 ValueIterator values_end() const;
00216
00226 docid get_docid() const;
00227
00229 std::string get_description() const;
00230 };
00231
00232 }
00233
00234 #endif // XAPIAN_INCLUDED_DOCUMENT_H