00001 00004 /* ----START-LICENCE---- 00005 * Copyright 1999,2000,2001 BrightStation PLC 00006 * Copyright 2002 Ananova Ltd 00007 * Copyright 2002 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 OM_HGUARD_OMDOCUMENT_H 00027 #define OM_HGUARD_OMDOCUMENT_H 00028 00029 #include "om/omtypes.h" 00030 #include "om/omtermlistiterator.h" 00031 #include "om/omvalueiterator.h" 00032 00034 class OmDocument { 00035 public: 00036 class Internal; 00038 Internal *internal; 00039 00040 public: 00045 explicit OmDocument(OmDocument::Internal *internal_); 00046 00050 OmDocument(const OmDocument &other); 00051 00055 void operator=(const OmDocument &other); 00056 00058 OmDocument(); 00059 00061 ~OmDocument(); 00062 00064 std::string get_value(om_valueno value) const; 00065 00067 // same number. 00068 void add_value(om_valueno valueno, const std::string &value); 00069 00071 void remove_value(om_valueno valueno); 00072 00074 void clear_values(); 00075 00081 std::string get_data() const; 00082 00084 void set_data(const std::string &data); 00085 00100 void add_posting(const om_termname & tname, 00101 om_termpos tpos, 00102 om_termcount wdfinc = 1); 00103 00114 void add_term_nopos(const om_termname & tname, 00115 om_termcount wdfinc = 1); 00116 00136 void remove_posting(const om_termname & tname, 00137 om_termpos tpos, 00138 om_termcount wdfdec = 1); 00139 00147 void remove_term(const om_termname & tname); 00148 00150 void clear_terms(); 00151 00153 om_termcount termlist_count(); 00154 00156 OmTermIterator termlist_begin() const; 00157 00159 OmTermIterator termlist_end() const; 00160 00162 om_termcount values_count(); 00163 00165 OmValueIterator values_begin() const; 00166 00168 OmValueIterator values_end() const; 00169 00174 std::string get_description() const; 00175 }; 00176 00177 #endif // OM_HGUARD_OMDOCUMENT_H