/[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 91424 - (hide annotations)
Tue Oct 26 18:39:32 2004 UTC (15 years, 4 months ago) by manus_eiffel
File size: 2753 byte(s)
Initial revision

1 manus_eiffel 91424 indexing
2     description: "References to objects containing a unicode character value"
3     status: "See notice at end of class"
4     date: "$Date$"
5     revision: "$Revision$"
6    
7     class
8     WIDE_CHARACTER_REF
9    
10     inherit
11     COMPARABLE
12     redefine
13     is_equal, out
14     end
15    
16     HASHABLE
17     redefine
18     is_hashable, is_equal, out
19     end
20    
21     feature -- Access
22    
23     item: WIDE_CHARACTER
24     -- Unicde character value
25    
26     hash_code, code: INTEGER is
27     -- Associated integer value and hash code value
28     do
29     Result := chcode (item)
30     end
31    
32     feature -- Status report
33    
34     is_hashable: BOOLEAN is True
35     -- May current object be hashed?
36    
37     feature -- Comparison
38    
39     infix "<" (other: like Current): BOOLEAN is
40     -- Is `other' greater than current character?
41     do
42     Result := item < other.item
43     end
44    
45     is_equal (other: like Current): BOOLEAN is
46     -- Is `other' attached to an object of the same type
47     -- as current object and identical to it?
48     do
49     Result := other.item = item
50     end
51    
52     feature -- Element change
53    
54     set_item (c: WIDE_CHARACTER) is
55     -- Make `c' the `item' value.
56     do
57     item := c
58     end
59    
60     feature -- Output
61    
62     out: STRING is
63     -- Printable representation of wide character
64     do
65     create Result.make (6)
66     Result.extend ('U')
67     Result.extend ('+')
68     Result.append (chcode (item).to_hex_string)
69     end
70    
71     feature {NONE} -- Initialization
72    
73     make_from_reference (v: WIDE_CHARACTER_REF) is
74     -- Initialize `Current' with `v.item'.
75     require
76     v_not_void: V /= Void
77     do
78     item := v.item
79     ensure
80     item_set: item = v.item
81     end
82    
83     feature -- Conversion
84    
85     to_reference: WIDE_CHARACTER_REF is
86     -- Associated reference of Current
87     do
88     create Result
89     Result.set_item (item)
90     ensure
91     to_reference_not_void: Result /= Void
92     end
93    
94     feature {NONE} -- Implementation
95    
96     chcode (c: like item): INTEGER is
97     -- Associated integer value
98     external
99     "built_in"
100     end
101    
102     indexing
103    
104     library: "[
105     EiffelBase: Library of reusable components for Eiffel.
106     ]"
107    
108     status: "[
109     Copyright 1986-2001 Interactive Software Engineering (ISE).
110     For ISE customers the original versions are an ISE product
111     covered by the ISE Eiffel license and support agreements.
112     ]"
113    
114     license: "[
115     EiffelBase may now be used by anyone as FREE SOFTWARE to
116     develop any product, public-domain or commercial, without
117     payment to ISE, under the terms of the ISE Free Eiffel Library
118     License (IFELL) at http://eiffel.com/products/base/license.html.
119     ]"
120    
121     source: "[
122     Interactive Software Engineering Inc.
123     ISE Building
124     360 Storke Road, Goleta, CA 93117 USA
125     Telephone 805-685-1006, Fax 805-685-6869
126     Electronic mail <info@eiffel.com>
127     Customer support http://support.eiffel.com
128     ]"
129    
130     info: "[
131     For latest info see award-winning pages: http://eiffel.com
132     ]"
133    
134     end -- class WIDE_CHARACTER_REF
135    
136    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23