00001 /* omdocument.h: representation of a document 00002 * 00003 * ----START-LICENCE---- 00004 * Copyright 1999,2000,2001 BrightStation PLC 00005 * Copyright 2002 Ananova Ltd 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License as 00009 * published by the Free Software Foundation; either version 2 of the 00010 * License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 * USA 00021 * -----END-LICENCE----- 00022 */ 00023 00024 #ifndef OM_HGUARD_OMDOCUMENT_H 00025 #define OM_HGUARD_OMDOCUMENT_H 00026 00027 #include "om/omtypes.h" 00028 #include "om/omtermlistiterator.h" 00029 #include "om/omvalueiterator.h" 00030 00032 class OmDocument { 00033 public: 00034 class Internal; 00036 Internal *internal; 00037 00038 public: 00043 explicit OmDocument(OmDocument::Internal *internal_); 00044 00048 OmDocument(const OmDocument &other); 00049 00053 void operator=(const OmDocument &other); 00054 00056 OmDocument(); 00057 00059 ~OmDocument(); 00060 00062 string get_value(om_valueno value) const; 00063 00065 // same number. 00066 void add_value(om_valueno valueno, const string &value); 00067 00069 void remove_value(om_valueno valueno); 00070 00072 void clear_values(); 00073 00079 std::string get_data() const; 00080 00082 void set_data(const std::string &data); 00083 00098 void add_posting(const om_termname & tname, 00099 om_termpos tpos, 00100 om_termcount wdfinc = 1); 00101 00112 void add_term_nopos(const om_termname & tname, 00113 om_termcount wdfinc = 1); 00114 00134 void remove_posting(const om_termname & tname, 00135 om_termpos tpos, 00136 om_termcount wdfdec = 1); 00137 00145 void remove_term(const om_termname & tname); 00146 00148 void clear_terms(); 00149 00151 om_termcount termlist_count(); 00152 00154 OmTermIterator termlist_begin() const; 00155 00157 OmTermIterator termlist_end() const; 00158 00160 om_termcount values_count(); 00161 00163 OmValueIterator values_begin() const; 00164 00166 OmValueIterator values_end() const; 00167 00172 std::string get_description() const; 00173 }; 00174 00175 #endif // OM_HGUARD_OMDOCUMENT_H