Panda3D
rangeIterator.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file rangeIterator.h
10  * @author drose
11  * @date 2003-09-07
12  */
13 
14 #ifndef RANGEITERATOR_H
15 #define RANGEITERATOR_H
16 
17 #include "pandatoolbase.h"
18 #include "rangeDescription.h"
19 
20 #include "pset.h"
21 
22 /**
23  * Walks through all the Unicode characters described by a RangeDescription
24  * class.
25  */
27 public:
28  RangeIterator(const RangeDescription &desc);
29 
30  INLINE int get_code() const;
31  bool next();
32  INLINE bool eof() const;
33 
34 private:
35  const RangeDescription &_desc;
36  RangeDescription::RangeList::const_iterator _it;
37  int _code;
38 
39  typedef pset<int> Codes;
40  Codes _codes_generated;
41 };
42 
43 #include "rangeIterator.I"
44 
45 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Walks through all the Unicode characters described by a RangeDescription class.
Definition: rangeIterator.h:26
RangeIterator(const RangeDescription &desc)
Constructs an iterator to walk through the codes on the descriptor.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:27
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:19