/[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 91434 - (show annotations)
Wed Oct 27 19:58:22 2004 UTC (15 years, 4 months ago) by manus_eiffel
File size: 1988 byte(s)
Updated indexing clause to match Eiffel Forum license and the copyright.

1 indexing
2 description: "References to objects containing a unicode character value"
3 library: "Free implementation of ELKS library"
4 copyright: "Copyright (c) 1986-2004, 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
26 -- Unicde character value
27
28 hash_code, code: INTEGER is
29 -- Associated integer value and hash code value
30 do
31 Result := chcode (item)
32 end
33
34 feature -- Status report
35
36 is_hashable: BOOLEAN is True
37 -- May current object be hashed?
38
39 feature -- Comparison
40
41 infix "<" (other: like Current): BOOLEAN is
42 -- Is `other' greater than current character?
43 do
44 Result := item < other.item
45 end
46
47 is_equal (other: like Current): BOOLEAN is
48 -- Is `other' attached to an object of the same type
49 -- as current object and identical to it?
50 do
51 Result := other.item = item
52 end
53
54 feature -- Element change
55
56 set_item (c: WIDE_CHARACTER) is
57 -- Make `c' the `item' value.
58 do
59 item := c
60 end
61
62 feature -- Output
63
64 out: STRING is
65 -- Printable representation of wide character
66 do
67 create Result.make (6)
68 Result.extend ('U')
69 Result.extend ('+')
70 Result.append (chcode (item).to_hex_string)
71 end
72
73 feature {NONE} -- Initialization
74
75 make_from_reference (v: WIDE_CHARACTER_REF) is
76 -- Initialize `Current' with `v.item'.
77 require
78 v_not_void: V /= Void
79 do
80 item := v.item
81 ensure
82 item_set: item = v.item
83 end
84
85 feature -- Conversion
86
87 to_reference: WIDE_CHARACTER_REF is
88 -- Associated reference of Current
89 do
90 create Result
91 Result.set_item (item)
92 ensure
93 to_reference_not_void: Result /= Void
94 end
95
96 feature {NONE} -- Implementation
97
98 chcode (c: like item): INTEGER is
99 -- Associated integer value
100 external
101 "built_in"
102 end
103
104 end -- class WIDE_CHARACTER_REF

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23