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

include/om/omvalueiterator.h

00001 /* omvalueiterator.h
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_OMVALUEITERATOR_H
00025 #define OM_HGUARD_OMVALUEITERATOR_H
00026 
00027 #include <iterator>
00028 #include <string>
00029 using std::string;
00030 #include "om/omtypes.h"
00031 
00032 class OmDocument;
00033 
00036 class OmValueIterator {
00037     public:
00038         class Internal;
00040         Internal *internal;
00041 
00042     private:
00043         friend class OmDocument; // So OmDocument can construct us
00044 
00045         friend bool operator==(const OmValueIterator &a, const OmValueIterator &b);
00046 
00047         OmValueIterator(Internal *internal_);
00048 
00049     public:
00051         OmValueIterator();
00052 
00054         ~OmValueIterator();
00055 
00057         OmValueIterator(const OmValueIterator &other);
00058 
00060         void operator=(const OmValueIterator &other);
00061 
00062         OmValueIterator & operator++();
00063 
00064         void operator++(int);
00065 
00067         const string & operator *() const;
00068 
00070         const string * operator ->() const;
00071 
00073         om_valueno get_valueno() const;
00074 
00078         std::string get_description() const;
00079 
00081 
00082         typedef std::input_iterator_tag iterator_category;
00083         typedef string value_type;
00084         typedef om_valueno_diff difference_type;
00085         typedef string * pointer;
00086         typedef string & reference;
00088 };
00089 
00090 inline bool operator!=(const OmValueIterator &a, const OmValueIterator &b)
00091 {
00092     return !(a == b);
00093 }
00094 
00095 #endif /* OM_HGUARD_OMVALUEITERATOR_H */

Documentation for Xapian (version 0.5.1).
Generated on 6 Oct 2002 by Doxygen 1.2.15.