class UNICODE_STRING
Summary
WARNING: THIS CLASS IS A WORK IN PROGRESS. SOME FEATURE ARE NOT YET IMPLEMENTED AND SOME FEATURE MAY APPEAR/DISAPPEAR.
A UNICODE_STRING is a resizable string written with unicode values. From unicode.org: "Unicode provides a unique number for every character , no matter what the platform, no matter what the program, no matter what the language. WARNING: a grapheme may be described with many code. grapheme may be defined as "user character". Angstrom sign one grapheme but may be defined using (LETTER A + COMBINING RING). Unicode strings may be acceded in two ways: - low-level (code by code) - high-level (grapheme by grapheme) Unless otherwise specified, all functions unit is the unicode number.
Direct parents
Inherit list: COMPARABLE, HASHABLE, RECYCLABLE, SEARCHABLE, TRAVERSABLE
Insert list: UNICODE_STRING_HELPER
Class invariant
Overview
Creation features
{ANY}
Features
{UNICODE_STRING, UNICODE_STRING_HANDLER}
{ANY}
Creation / Modification:
{ANY}
Testing:
{ANY}
Testing and Conversion:
{ANY}
{}
Modification:
{ANY}
Printing:
{ANY}
Other features:
{ANY}
Splitting a STRING:
{ANY}
  • split: ARRAY[UNICODE_STRING]
    Split the string into an array of words.
  • split_in (words: COLLECTION[UNICODE_STRING])
    Same jobs as split but result is appended in words.
Other features:
{ANY}
{UNICODE_STRING, UNICODE_STRING_HANDLER}
{}
{}
{}
{RECYCLING_POOL}
  • recycle
    Do whatever needs to be done to free resources or recycle other objects when recycling this one
{ANY}
  • infix "<=" (other: UNICODE_STRING): BOOLEAN
    Is Current less than or equal other?
  • infix ">" (other: UNICODE_STRING): BOOLEAN
    Is Current strictly greater than other?
  • infix ">=" (other: UNICODE_STRING): BOOLEAN
    Is Current greater than or equal than other?
  • in_range (lower: UNICODE_STRING, upper: UNICODE_STRING): BOOLEAN
    Return True if Current is in range [lower..upper]
    See also min, max, compare.
  • min (other: UNICODE_STRING): UNICODE_STRING
    Minimum of Current and other.
  • max (other: UNICODE_STRING): UNICODE_STRING
    Maximum of Current and other.
  • bounded_by (a_min: UNICODE_STRING, a_max: UNICODE_STRING): UNICODE_STRING
    A value that is equal to Current if it is between the limits set by a_min and a_max.
{ANY}
Other features:
{ANY}
Agent-based features:
{ANY}
{ANY}
Agent-based features:
{ANY}
{}
Indexing:
{ANY}
{ANY}
The place where characters are stored.
count: INTEGER_32
writable attribute
{ANY}
String length which is also the maximum valid index.
capacity: INTEGER_32
writable attribute
{ANY}
Capacity of the storage area.
lower: INTEGER_32
is 1
constant attribute
{ANY}
Minimum index; actually, this is always 1 (this feature here to mimic the one of the COLLECTION hierarchy).
upper: INTEGER_32
effective function
{ANY}
Maximum index; actually the same value as count (this feature is here to mimic the one of the COLLECTION hierarchy).
make (needed_capacity: INTEGER_32)
effective procedure
{ANY}
Initialize the string to have at least needed_capacity characters of storage.
make_empty
effective procedure
{ANY}
Create an empty string.
make_filled (unicode: INTEGER_32, n: INTEGER_32)
effective procedure
{ANY}
Initialize string with n copies of unicode.
is_empty: BOOLEAN
effective function
{ANY}
Has string length 0?
effective function
{ANY}
Get unicode at position i.
infix "@" (i: INTEGER_32): INTEGER_32
effective function
{ANY}
The infix notation which is actually just a synonym for item.
hash_code: INTEGER_32
effective function
{ANY}
The hash-code value of Current.
infix "<" (other: UNICODE_STRING): BOOLEAN
effective function
{ANY}
Is Current less than other?
compare (other: UNICODE_STRING): INTEGER_32
effective function
{ANY}
If current object equal to other, 0 if smaller, -1; if greater, 1.
three_way_comparison (other: UNICODE_STRING): INTEGER_32
effective function
{ANY}
If current object equal to other, 0 if smaller, -1; if greater, 1.
is_equal (other: UNICODE_STRING): BOOLEAN
effective function
{ANY}
Do both strings have the same character sequence?
same_as (other: UNICODE_STRING): BOOLEAN
effective function
{ANY}
Case insensitive is_equal.
index_of (unicode: INTEGER_32, start_index: INTEGER_32): INTEGER_32
effective function
{ANY}
Index of first occurrence of unicode at or after start_index, 0 if none.
fast_index_of (unicode: INTEGER_32, start_index: INTEGER_32): INTEGER_32
effective function
{ANY}
Index of first occurrence of unicode at or after start_index, 0 if none.
reverse_index_of (unicode: INTEGER_32, start_index: INTEGER_32): INTEGER_32
effective function
{ANY}
Index of first occurrence of unicode at or before start_index, 0 if none.
fast_reverse_index_of (unicode: INTEGER_32, start_index: INTEGER_32): INTEGER_32
effective function
{ANY}
Index of first occurrence of unicode at or before start_index, 0 if none.
first_index_of (unicode: INTEGER_32): INTEGER_32
effective function
{ANY}
Index of first occurrence of unicode at index 1 or after index 1.
fast_first_index_of (unicode: INTEGER_32): INTEGER_32
effective function
{ANY}
Index of first occurrence of unicode at index 1 or after index 1.
last_index_of (unicode: INTEGER_32): INTEGER_32
effective function
{ANY}
Index of last occurrence of unicode, 0 if none.
fast_last_index_of (unicode: INTEGER_32): INTEGER_32
effective function
{ANY}
Index of last occurrence of unicode, 0 if none.
has (unicode: INTEGER_32): BOOLEAN
effective function
{ANY}
True if unicode is in the STRING.
fast_has (unicode: INTEGER_32): BOOLEAN
effective function
{ANY}
True if unicode is in the STRING.
has_substring (other: UNICODE_STRING): BOOLEAN
effective function
{ANY}
True if Current contains other.
occurrences (unicode: INTEGER_32): INTEGER_32
effective function
{ANY}
Number of times character unicode appears in the string.
has_suffix (s: UNICODE_STRING): BOOLEAN
effective function
{ANY}
True if suffix of Current is s.
has_prefix (p: UNICODE_STRING): BOOLEAN
effective function
{ANY}
True if prefix of Current is p.
is_ascii: BOOLEAN
effective function
{ANY}
True if all unicode value is in range 0..127
to_utf8: STRING
effective function
{ANY}
New string is created, current unicode string is encoded with UTF-8 format.
as_utf8: STRING
effective function
{ANY}
Encode the string in UTF-8.
utf8_encode_in (s: STRING)
effective procedure
{ANY}
Append the string in UTF-8 to s.
utf16be_encode_in (s: STRING)
effective procedure
{ANY}
Append the string in UTF-16BE to s
utf8_decode_from (s: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Use s as UTF-8 format encoded unicode string Return False if decoding process failed
from_utf8 (s: ABSTRACT_STRING)
effective procedure
{}
Use s as UTF-8 format encoded unicode string This function may be used for manifest strings See utf8_decode_from for error detection
resize (new_count: INTEGER_32)
effective procedure
{ANY}
Resize Current.
clear_count
effective procedure
{ANY}
Discard all characters so that is_empty is True after that call.
wipe_out
effective procedure
{ANY}
Discard all characters so that is_empty is True after that call.
clear_count_and_capacity
effective procedure
{ANY}
Discard all characters (is_empty is True after that call).
copy (other: UNICODE_STRING)
effective procedure
{ANY}
Copy other onto Current.
copy_substring (s: UNICODE_STRING, start_index: INTEGER_32, end_index: INTEGER_32)
effective procedure
{ANY}
Copy the substring from s from start_index to end_index to Current.
fill_with (unicode: INTEGER_32)
effective procedure
{ANY}
Replace every unicode with the new value.
replace_all (old_code: INTEGER_32, new_code: INTEGER_32)
effective procedure
{ANY}
Replace all occurrences of the element old_code by new_code.
append (s: UNICODE_STRING)
effective procedure
{ANY}
Append a copy of 's' to Current.
append_string (s: UNICODE_STRING)
effective procedure
{ANY}
Append a copy of 's' to Current.
append_substring (s: UNICODE_STRING, start_index: INTEGER_32, end_index: INTEGER_32)
effective procedure
{ANY}
Append the substring from s from start_index to end_index to Current.
prepend (other: UNICODE_STRING)
effective procedure
{ANY}
Prepend other to Current.
insert_string (s: UNICODE_STRING, i: INTEGER_32)
effective procedure
{ANY}
Insert s at index i, shifting characters from index i to count rightwards.
replace_substring (s: UNICODE_STRING, start_index: INTEGER_32, end_index: INTEGER_32)
effective procedure
{ANY}
Replace the substring from start_index to end_index, inclusive, with s.
infix "+" (other: UNICODE_STRING): UNICODE_STRING
effective function
{ANY}
Create a new UNICODE_STRING which is the concatenation of Current and other.
put (unicode: INTEGER_32, i: INTEGER_32)
effective procedure
{ANY}
Put unicode at position i.
swap (i1: INTEGER_32, i2: INTEGER_32)
effective procedure
{ANY}
Swap two characters.
insert_character (unicode: INTEGER_32, i: INTEGER_32)
effective procedure
{ANY}
Inserts unicode at index i, shifting characters from position 'i' to count rightwards.
shrink (min_index: INTEGER_32, max_index: INTEGER_32)
effective procedure
{ANY}
Keep only the slice [min_index .. max_index] or nothing when the slice is empty.
remove (i: INTEGER_32)
effective procedure
{ANY}
Remove character at position i.
add_first (unicode: INTEGER_32)
effective procedure
{ANY}
Add unicode at first position.
precede (unicode: INTEGER_32)
effective procedure
{ANY}
Add unicode at first position.
add_last (unicode: INTEGER_32)
effective procedure
{ANY}
Append unicode to string.
append_character (unicode: INTEGER_32)
effective procedure
{ANY}
Append unicode to string.
extend (unicode: INTEGER_32)
effective procedure
{ANY}
Append unicode to string.
to_lower
effective procedure
{ANY}
Convert all characters to lower case.
to_upper
effective procedure
{ANY}
Convert all characters to upper case.
as_lower: UNICODE_STRING
effective function
{ANY}
New object with all letters in lower case.
as_upper: UNICODE_STRING
effective function
{ANY}
New object with all letters in upper case.
keep_head (n: INTEGER_32)
effective procedure
{ANY}
Remove all characters except for the first n.
keep_tail (n: INTEGER_32)
effective procedure
{ANY}
Remove all characters except for the last n.
remove_first
effective procedure
{ANY}
Remove the first item.
remove_head (n: INTEGER_32)
effective procedure
{ANY}
Remove n first characters.
remove_last
effective procedure
{ANY}
Remove the last item.
remove_tail (n: INTEGER_32)
effective procedure
{ANY}
Remove n last characters.
remove_substring (start_index: INTEGER_32, end_index: INTEGER_32)
effective procedure
{ANY}
Remove all characters from strt_index to end_index inclusive.
remove_between (start_index: INTEGER_32, end_index: INTEGER_32)
effective procedure
{ANY}
Remove all characters from strt_index to end_index inclusive.
remove_suffix (s: UNICODE_STRING)
effective procedure
{ANY}
Remove the suffix s of current string.
remove_prefix (s: UNICODE_STRING)
effective procedure
{ANY}
Remove the prefix s of current string.
left_adjust
effective procedure
{ANY}
Remove leading blanks.
right_adjust
effective procedure
{ANY}
Remove trailing blanks.
out_in_tagged_out_memory
effective procedure
{ANY}
Append terse printable representation of current object in tagged_out_memory.
fill_tagged_out_memory
effective procedure
{ANY}
Append a viewable information in tagged_out_memory in order to affect the behavior of out, tagged_out, etc.
first: INTEGER_32
effective function
{ANY}
Access to the very first character.
last: INTEGER_32
effective function
{ANY}
Access to the very last character.
substring (start_index: INTEGER_32, end_index: INTEGER_32): UNICODE_STRING
effective function
{ANY}
New string consisting of items [start_index.. end_index].
extend_multiple (unicode: INTEGER_32, n: INTEGER_32)
effective procedure
{ANY}
Extend Current with n times character unicode.
precede_multiple (unicode: INTEGER_32, n: INTEGER_32)
effective procedure
{ANY}
Prepend n times character unicode to Current.
extend_to_count (unicode: INTEGER_32, needed_count: INTEGER_32)
effective procedure
{ANY}
Extend Current with unicode until needed_count is reached.
precede_to_count (unicode: INTEGER_32, needed_count: INTEGER_32)
effective procedure
{ANY}
Prepend unicode to Current until needed_count is reached.
reverse
effective procedure
{ANY}
Reverse the string.
remove_all_occurrences (unicode: INTEGER_32)
effective procedure
{ANY}
Remove all occurrences of unicode.
substring_index (other: UNICODE_STRING, start_index: INTEGER_32): INTEGER_32
effective function
{ANY}
Position of first occurrence of other at or after start, 0 if none.
first_substring_index (other: UNICODE_STRING): INTEGER_32
effective function
{ANY}
Position of first occurrence of other at or after 1, 0 if none.
split: ARRAY[UNICODE_STRING]
effective function
{ANY}
Split the string into an array of words.
split_in (words: COLLECTION[UNICODE_STRING])
effective procedure
{ANY}
Same jobs as split but result is appended in words.
extend_unless (unicode: INTEGER_32)
effective procedure
{ANY}
Extend Current (using extend) with unicode unless unicode ch is already the last character.
new_iterator: ITERATOR[INTEGER_32]
effective function
{ANY}
valid_unicode (unicode: INTEGER_32): BOOLEAN
effective function
{ANY}
is_space (unicode: INTEGER_32): BOOLEAN
effective function
{ANY}
is_separator (unicode: INTEGER_32): BOOLEAN
effective function
{ANY}
is_combining (unicode: INTEGER_32): BOOLEAN
effective function
{ANY}
low_surrogate_indexes: FAST_ARRAY[INTEGER_32]
writable attribute
user indexes (starting at 1)
low_surrogate_values: FAST_ARRAY[INTEGER_16]
writable attribute
low surrogate value is stored without 0xDC00 part and endianness dependant !
set_count (new_count: INTEGER_32)
effective procedure
string_buffer: UNICODE_STRING
once function
{}
Private, temporary once buffer.
tmp_buffer: STRING
once function
{}
Private, temporary once buffer.
split_buffer: ARRAY[UNICODE_STRING]
once function
{}
low_surrogate_value (index: INTEGER_32): INTEGER_16
effective function
{}
low_surrogate_index (index: INTEGER_32): INTEGER_32
effective function
{}
low_surrogate_position (index: INTEGER_32): INTEGER_32
effective function
{}
return position to use in low_surrogate* arrays relative to character at index in the string (return the good answer if the corresponding character is not surrogate)
valid_surrogates: BOOLEAN
effective function
{}
manifest_initialize (c: INTEGER_32, s: NATIVE_ARRAY[INTEGER_16], ls_cap: INTEGER_32, lsv: NATIVE_ARRAY[INTEGER_16], lsi: NATIVE_ARRAY[INTEGER_32])
effective procedure
{}
This function is a compiler-hook automatically called when a manifest unicode string (i.e. U"foo") is used in the Eiffel source code.
debug_utf8: STRING
writable attribute
{}
set_debug_utf8
effective procedure
{}
next_generation
effective procedure
{}
recycle
effective procedure
Do whatever needs to be done to free resources or recycle other objects when recycling this one
infix "<=" (other: UNICODE_STRING): BOOLEAN
effective function
{ANY}
Is Current less than or equal other?
infix ">" (other: UNICODE_STRING): BOOLEAN
effective function
{ANY}
Is Current strictly greater than other?
infix ">=" (other: UNICODE_STRING): BOOLEAN
effective function
{ANY}
Is Current greater than or equal than other?
in_range (lower: UNICODE_STRING, upper: UNICODE_STRING): BOOLEAN
effective function
{ANY}
Return True if Current is in range [lower..upper]
See also min, max, compare.
min (other: UNICODE_STRING): UNICODE_STRING
effective function
{ANY}
Minimum of Current and other.
max (other: UNICODE_STRING): UNICODE_STRING
effective function
{ANY}
Maximum of Current and other.
bounded_by (a_min: UNICODE_STRING, a_max: UNICODE_STRING): UNICODE_STRING
effective function
{ANY}
A value that is equal to Current if it is between the limits set by a_min and a_max.
enumerate: ENUMERATE[E_]
effective function
{ANY}
get_new_iterator: ITERATOR[E_]
frozen
effective function
{ANY}
for_each (action: PROCEDURE[TUPLE[TUPLE 1[E_]]])
effective procedure
{ANY}
Apply action to every item of Current.
for_all (test: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
{ANY}
Do all items satisfy test?
exists (test: FUNCTION[TUPLE[TUPLE 1[E_]]]): BOOLEAN
effective function
{ANY}
Does at least one item satisfy test?
aggregate (action: FUNCTION[TUPLE[TUPLE 2[E_, E_], E_]], initial: E_): E_
effective function
{ANY}
Aggregate all the elements starting from the initial value.
generation: INTEGER_32
writable attribute
{ANY}
do_all (action: ROUTINE[TUPLE[TUPLE 1[E_]]])
frozen
effective procedure
{ANY}
Apply action to every item of Current.
_inline_agent1 (a: ROUTINE[TUPLE[TUPLE 1[E_]]], e: E_)
frozen
effective procedure
{}
valid_index (i: INTEGER_32): BOOLEAN
effective function
{ANY}
True when i is valid (i.e., inside actual bounds).
utf8_character_in (character: INTEGER_32, s: STRING)
effective procedure
{ANY}