Panda3D
 All Classes Functions Variables Enumerations
rangeDescription.I
1 // Filename: rangeDescription.I
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: RangeDescription::add_singleton
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE void RangeDescription::
22 add_singleton(int code) {
23  _range_list.push_back(Range(code));
24 }
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: RangeDescription::add_range
28 // Access: Public
29 // Description:
30 ////////////////////////////////////////////////////////////////////
31 INLINE void RangeDescription::
32 add_range(int from_code, int to_code) {
33  _range_list.push_back(Range(from_code, to_code));
34 }
35 
36 ////////////////////////////////////////////////////////////////////
37 // Function: RangeDescription::is_empty
38 // Access: Public
39 // Description: Returns true if there are no codes described in the
40 // range.
41 ////////////////////////////////////////////////////////////////////
42 INLINE bool RangeDescription::
43 is_empty() const {
44  return _range_list.empty();
45 }
46 
47 ////////////////////////////////////////////////////////////////////
48 // Function: RangeDescription::Range::Constructor
49 // Access: Public
50 // Description:
51 ////////////////////////////////////////////////////////////////////
52 INLINE RangeDescription::Range::
53 Range(int code) :
54  _from_code(code),
55  _to_code(code)
56 {
57 }
58 
59 ////////////////////////////////////////////////////////////////////
60 // Function: RangeDescription::Range::Constructor
61 // Access: Public
62 // Description:
63 ////////////////////////////////////////////////////////////////////
64 INLINE RangeDescription::Range::
65 Range(int from_code, int to_code) :
66  _from_code(from_code),
67  _to_code(to_code)
68 {
69 }
70 
71 INLINE ostream &operator << (ostream &out, const RangeDescription &range) {
72  range.output(out);
73  return out;
74 }
bool is_empty() const
Returns true if there are no codes described in the range.
This describes a sparse range of Unicode character codes for conversion that may be specified on the ...