Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

include/om/omdocument.h

00001 /* omdocument.h: representation of a document
00002  *
00003  * ----START-LICENCE----
00004  * Copyright 1999,2000,2001 BrightStation PLC
00005  * Copyright 2002 Ananova Ltd
00006  * Copyright 2002 Olly Betts
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License as
00010  * published by the Free Software Foundation; either version 2 of the
00011  * License, or (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021  * USA
00022  * -----END-LICENCE-----
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         //  same number.
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

Documentation for Xapian (version 0.5.2).
Generated on 12 Oct 2002 by Doxygen 1.2.15.