Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

kernel.unicode

Class UC_UNICODE_FACTORY


Direct ancestors

UC_IMPORTED_UTF8_ROUTINES, UC_IMPORTED_UTF16_ROUTINES, UC_IMPORTED_UNICODE_ROUTINES, KL_IMPORTED_ANY_ROUTINES

Known direct descendants

UT_URL_ENCODING, XM_DTD_ATTRIBUTE_CONTENT, XM_ATTRIBUTE_DEFAULT_FILTER, XM_DTD_ELEMENT_CONTENT, XM_NAMESPACE_RESOLVER_CONTEXT, XM_EIFFEL_PARSER_SKELETON

Features

Invariants

indexing

description

Unicode factories

library

Gobo Eiffel Kernel Library

copyright

Copyright (c) 2001-2002, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/02/07 16:26:13 $

revision

$Revision: 1.11 $

class

UC_UNICODE_FACTORY

inherit

UC_IMPORTED_UTF8_ROUTINES
UC_IMPORTED_UTF16_ROUTINES
UC_IMPORTED_UNICODE_ROUTINES
KL_IMPORTED_ANY_ROUTINES

feature -- Access

any_: KL_ANY_ROUTINES

-- Routines that ought to be in class ANY

-- (From KL_IMPORTED_ANY_ROUTINES)

ensure
any_routines_not_void: Result /= Void
new_unicode_character (a_char: CHARACTER): UC_CHARACTER

-- New unicode character from Latin-1 character a_char

ensure
new_character_not_void: Result /= Void
code_set: Result.code = a_char.code
new_unicode_string (a_string: STRING): UC_STRING

-- New unicode string made up of the characters from a_string

require
a_string_not_void: a_string /= Void
ensure
new_string_not_void: Result /= Void
count_set: Result.count = a_string.count
new_unicode_string_empty: UC_STRING

-- New empty unicode string

ensure
new_string_not_void: Result /= Void
empty: Result.count = 0
new_unicode_string_filled (c: CHARACTER; n: INTEGER): UC_STRING

-- New unicode string of length n filled with character c

require
valid_count: n >= 0
ensure
new_string_not_void: Result /= Void
count_set: Result.count = n
occurrences: Result.occurrences (c) = n
new_unicode_string_filled_code (a_code: INTEGER; n: INTEGER): UC_STRING

-- New unicode string of length n filled with unicode
-- character of code a_code

require
valid_code: unicode.valid_code (a_code)
valid_count: n >= 0
ensure
new_string_not_void: Result /= Void
count_set: Result.count = n
occurrences: Result.code_occurrences (a_code) = n
new_unicode_string_filled_unicode (c: UC_CHARACTER; n: INTEGER): UC_STRING

-- New unicode string of length n filled with unicode character c

require
c_not_void: c /= Void
valid_count: n >= 0
ensure
new_string_not_void: Result /= Void
count_set: Result.count = n
occurrences: Result.unicode_occurrences (c) = n
new_unicode_string_from_substring (a_string: STRING; start_index, end_index: INTEGER): UC_STRING

-- New unicode string made up of the character sequence of
-- a_string between start_index and end_index inclusive

require
a_string_not_void: a_string /= Void
valid_start_index: 1 <= start_index
valid_end_index: end_index <= a_string.count
meaningful_interval: start_index <= end_index + 1
ensure
new_string_not_void: Result /= Void
count_set: Result.count = (end_index - start_index + 1)
new_unicode_string_from_utf16 (a_string: STRING): UC_STRING

-- New unicode string made up of the characters
-- from a_string encoded in UTF-16

require
a_string_not_void: a_string /= Void
a_string_is_string: ANY_.same_types (a_string,
)
valid_utf16: utf16.valid_utf16 (a_string)
ensure
new_string_not_void: Result /= Void
new_unicode_string_from_utf8 (a_string: STRING): UC_STRING

-- New unicode string made up of the characters
-- from a_string encoded in UTF-8

require
a_string_not_void: a_string /= Void
a_string_is_string: ANY_.same_types (a_string,
)
valid_utf8: utf8.valid_utf8 (a_string)
ensure
new_string_not_void: Result /= Void
new_unicode_string_with_capacity (suggested_capacity: INTEGER): UC_STRING

-- New empty unicode string

require
non_negative_suggested_capacity: suggested_capacity >= 0
ensure
new_string_not_void: Result /= Void
empty: Result.count = 0
byte_capacity_set: Result.byte_capacity >= suggested_capacity
unicode: UC_UNICODE_ROUTINES

-- Unicode routines

-- (From UC_IMPORTED_UNICODE_ROUTINES)

ensure
unicode_not_void: Result /= Void
utf16: UC_UTF16_ROUTINES

-- UTF-16 encoding routines

-- (From UC_IMPORTED_UTF16_ROUTINES)

ensure
utf16_not_void: Result /= Void
utf8: UC_UTF8_ROUTINES

-- UTF-8 encoding routines

-- (From UC_IMPORTED_UTF8_ROUTINES)

ensure
utf8_not_void: Result /= Void

invariant


-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end