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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 manus_eiffel 91424 indexing
2     description: "References to objects containing a unicode character value"
3 manus_eiffel 91434 library: "Free implementation of ELKS library"
4 ericb 91463 copyright: "Copyright (c) 1986-2006, Eiffel Software and others"
5 manus_eiffel 91434 license: "Eiffel Forum License v2 (see forum.txt)"
6 manus_eiffel 91424 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 ericb 91463 item: WIDE_CHARACTER is
26     -- Unicode character value
27     external
28     "built_in"
29     end
30 manus_eiffel 91424
31 ericb 91463 code: INTEGER is
32     -- Associated integer value
33 manus_eiffel 91424 do
34 ericb 91463 Result := item.code
35 manus_eiffel 91424 end
36    
37 ericb 91463 hash_code: INTEGER is
38     -- Hash code value
39     do
40     Result := code
41     end
42    
43 manus_eiffel 91424 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 ericb 91463 Result := code < other.code
54     ensure then
55     definition: Result = (code < other.code)
56 manus_eiffel 91424 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 ericb 91463 external
70     "built_in"
71 manus_eiffel 91424 end
72    
73     feature -- Output
74    
75     out: STRING is
76     -- Printable representation of wide character
77     do
78     create Result.make (6)
79 ericb 91463 Result.append_character ('U')
80     Result.append_character ('+')
81     Result.append_string (code.to_hex_string)
82 manus_eiffel 91424 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 ericb 91463 v_not_void: v /= Void
90 manus_eiffel 91424 do
91 ericb 91463 set_item (v)
92 manus_eiffel 91424 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 manus_eiffel 91438 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23