/[eiffelstudio]/FreeELKS/trunk/library/kernel/wide_character_ref.e
ViewVC logotype

Contents of /FreeELKS/trunk/library/kernel/wide_character_ref.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91463 - (show annotations)
Fri Feb 17 22:36:59 2006 UTC (13 years, 11 months ago) by ericb
File size: 1984 byte(s)
Made built-in features explicit

1 indexing
2 description: "References to objects containing a unicode character value"
3 library: "Free implementation of ELKS library"
4 copyright: "Copyright (c) 1986-2006, Eiffel Software and others"
5 license: "Eiffel Forum License v2 (see forum.txt)"
6 date: "$Date$"
7 revision: "$Revision$"
8
9 class
10 WIDE_CHARACTER_REF
11
12 inherit
13 COMPARABLE
14 redefine
15 is_equal, out
16 end
17
18 HASHABLE
19 redefine
20 is_hashable, is_equal, out
21 end
22
23 feature -- Access
24
25 item: WIDE_CHARACTER is
26 -- Unicode character value
27 external
28 "built_in"
29 end
30
31 code: INTEGER is
32 -- Associated integer value
33 do
34 Result := item.code
35 end
36
37 hash_code: INTEGER is
38 -- Hash code value
39 do
40 Result := code
41 end
42
43 feature -- Status report
44
45 is_hashable: BOOLEAN is True
46 -- May current object be hashed?
47
48 feature -- Comparison
49
50 infix "<" (other: like Current): BOOLEAN is
51 -- Is `other' greater than current character?
52 do
53 Result := code < other.code
54 ensure then
55 definition: Result = (code < other.code)
56 end
57
58 is_equal (other: like Current): BOOLEAN is
59 -- Is `other' attached to an object of the same type
60 -- as current object and identical to it?
61 do
62 Result := other.item = item
63 end
64
65 feature -- Element change
66
67 set_item (c: WIDE_CHARACTER) is
68 -- Make `c' the `item' value.
69 external
70 "built_in"
71 end
72
73 feature -- Output
74
75 out: STRING is
76 -- Printable representation of wide character
77 do
78 create Result.make (6)
79 Result.append_character ('U')
80 Result.append_character ('+')
81 Result.append_string (code.to_hex_string)
82 end
83
84 feature {NONE} -- Initialization
85
86 make_from_reference (v: WIDE_CHARACTER_REF) is
87 -- Initialize `Current' with `v.item'.
88 require
89 v_not_void: v /= Void
90 do
91 set_item (v)
92 ensure
93 item_set: item = v.item
94 end
95
96 feature -- Conversion
97
98 to_reference: WIDE_CHARACTER_REF is
99 -- Associated reference of Current
100 do
101 create Result
102 Result.set_item (item)
103 ensure
104 to_reference_not_void: Result /= Void
105 end
106
107 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23