00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef OM_HGUARD_OMDOCUMENT_H
00026 #define OM_HGUARD_OMDOCUMENT_H
00027
00028 #include "om/omtypes.h"
00029 #include "om/omtermlistiterator.h"
00030 #include "om/omvalueiterator.h"
00031
00033 class OmDocument {
00034 public:
00035 class Internal;
00037 Internal *internal;
00038
00039 public:
00044 explicit OmDocument(OmDocument::Internal *internal_);
00045
00049 OmDocument(const OmDocument &other);
00050
00054 void operator=(const OmDocument &other);
00055
00057 OmDocument();
00058
00060 ~OmDocument();
00061
00063 std::string get_value(om_valueno value) const;
00064
00066
00067 void add_value(om_valueno valueno, const std::string &value);
00068
00070 void remove_value(om_valueno valueno);
00071
00073 void clear_values();
00074
00080 std::string get_data() const;
00081
00083 void set_data(const std::string &data);
00084
00099 void add_posting(const om_termname & tname,
00100 om_termpos tpos,
00101 om_termcount wdfinc = 1);
00102
00113 void add_term_nopos(const om_termname & tname,
00114 om_termcount wdfinc = 1);
00115
00135 void remove_posting(const om_termname & tname,
00136 om_termpos tpos,
00137 om_termcount wdfdec = 1);
00138
00146 void remove_term(const om_termname & tname);
00147
00149 void clear_terms();
00150
00152 om_termcount termlist_count();
00153
00155 OmTermIterator termlist_begin() const;
00156
00158 OmTermIterator termlist_end() const;
00159
00161 om_termcount values_count();
00162
00164 OmValueIterator values_begin() const;
00165
00167 OmValueIterator values_end() const;
00168
00173 std::string get_description() const;
00174 };
00175
00176 #endif // OM_HGUARD_OMDOCUMENT_H