Panda3D
rangeIterator.h
1 // Filename: rangeIterator.h
2 // Created by: drose (07Sep03)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef RANGEITERATOR_H
16 #define RANGEITERATOR_H
17 
18 #include "pandatoolbase.h"
19 #include "rangeDescription.h"
20 
21 #include "pset.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : RangeIterator
25 // Description : Walks through all the Unicode characters described by
26 // a RangeDescription class.
27 ////////////////////////////////////////////////////////////////////
29 public:
30  RangeIterator(const RangeDescription &desc);
31 
32  INLINE int get_code() const;
33  bool next();
34  INLINE bool eof() const;
35 
36 private:
37  const RangeDescription &_desc;
38  RangeDescription::RangeList::const_iterator _it;
39  int _code;
40 
41  typedef pset<int> Codes;
42  Codes _codes_generated;
43 };
44 
45 #include "rangeIterator.I"
46 
47 #endif
48 
Walks through all the Unicode characters described by a RangeDescription class.
Definition: rangeIterator.h:28
RangeIterator(const RangeDescription &desc)
Constructs an iterator to walk through the codes on the descriptor.
bool next()
Advances the iterator to the next code.
bool eof() const
Returns true if all the code have been retrieved, false otherwise.
Definition: rangeIterator.I:34
This describes a sparse range of Unicode character codes for conversion that may be specified on the ...
int get_code() const
Returns the current Unicode value represented by the iterator, or -1 if the iterator has reached the ...
Definition: rangeIterator.I:23