Panda3D

rangeIterator.h

00001 // Filename: rangeIterator.h
00002 // Created by:  drose (07Sep03)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef RANGEITERATOR_H
00016 #define RANGEITERATOR_H
00017 
00018 #include "pandatoolbase.h"
00019 #include "rangeDescription.h"
00020 
00021 #include "pset.h"
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //       Class : RangeIterator
00025 // Description : Walks through all the Unicode characters described by
00026 //               a RangeDescription class.
00027 ////////////////////////////////////////////////////////////////////
00028 class RangeIterator {
00029 public:
00030   RangeIterator(const RangeDescription &desc);
00031 
00032   INLINE int get_code() const;
00033   bool next();
00034   INLINE bool eof() const;
00035 
00036 private:
00037   const RangeDescription &_desc;
00038   RangeDescription::RangeList::const_iterator _it;
00039   int _code;
00040 
00041   typedef pset<int> Codes;
00042   Codes _codes_generated;
00043 };
00044 
00045 #include "rangeIterator.I"
00046 
00047 #endif
00048 
 All Classes Functions Variables Enumerations