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

jutil.hh

00001 /********************************************************************************
00002  *   Jabberoo/Judo -- C++ Jabber Library                                        *
00003  *                                                                              * 
00004  *   Copyright (C) 1999-2000 Dave Smith (dave@jabber.org)                       *
00005  *                                                                              *
00006  *   This library is free software; you can redistribute it and/or              *
00007  *   modify it under the terms of the GNU Lesser General Public                 *
00008  *   License as published by the Free Software Foundation; either               *
00009  *   version 2.1 of the License, or (at your option) any later version.         *
00010  *                                                                              *
00011  *   This library is distributed in the hope that it will be useful,            *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of             *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU          *
00014  *   Lesser General Public License for more details.                            *
00015  *                                                                              *
00016  *   You should have received a copy of the GNU Lesser General Public           *
00017  *   License along with this library; if not, write to the Free Software        *
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
00019  ********************************************************************************
00020  */
00021 #ifndef INCL_JUTIL_H
00022 #define INCL_JUTIL_H
00023 
00024 #include <iterator>
00025 #include <string>
00026 
00027 namespace jutil
00028 {
00029      template<class Iter, class Value>
00030      class ValueIterator : public Iter {
00031      public:
00032           // Iterator traits (req. for use w/ std::algos)
00033           typedef std::bidirectional_iterator_tag iterator_category;
00034           typedef Value                      value_type;
00035           typedef ptrdiff_t                  difference_type;
00036           typedef value_type*                pointer;
00037           typedef value_type&                reference;
00038 
00039           ValueIterator() : Iter() {}
00040           ValueIterator(const Iter& i) 
00041                : Iter(i) {}
00042           ValueIterator(const ValueIterator& i) 
00043                : Iter(i) {}
00044 
00045           reference operator*() const
00046                {
00047                     return Iter::operator*().second;
00048                }
00049 
00050           pointer operator->() const
00051                {
00052                     return &(Iter::operator*().second);
00053                }
00054 
00055      };
00056 
00057      std::string getTimeStamp();
00058 
00059      struct CaseInsensitiveCmp {
00060           bool operator()(const std::string& lhs, const std::string& rhs) const;
00061      };
00062 }
00063 
00064 #endif

Generated on Thu Jul 24 13:31:51 2003 for jabberoo by doxygen1.3-rc3