Unless specified otherwise, STRING_8 and CHARACTER_8 are
supposed to contain characters whose code follows the
unicode character set. In other words characters whose
code is between 128 and 255 should follow the ISO 8859-1
Latin-1 character set.
By default UC_STRING is implemented using the UTF-8 encoding.
Use UC_UTF*_STRING to specify the encoding explicitly.
Gobo Eiffel Kernel Library
Copyright (c) 2001-2004, Eric Bezault and others
Eiffel Forum License v2 (see forum.txt)
-- Create string of length n filled with unicode
-- character of code a_code.
-- Create string of length n filled with unicode character c.
-- Initialize from the character sequence of a_string
-- between start_index and end_index inclusive.
-- Object of a type conforming to the type of s,
-- initialized with attributes from s
-- (From STRING_8)
-- Reset contents of string from substring of c_string,
-- a string created by some C function.
-- (From STRING_8)
-- Initialize from contents of c_string,
-- a string created by some C function
-- (From STRING_8)
-- Routines that ought to be in class STRING_8
-- (From KL_IMPORTED_STRING_ROUTINES)
-- UTF-16 encoding routines
-- (From UC_IMPORTED_UTF16_ROUTINES)
-- Special data zone
-- (From TO_SPECIAL)
-- Routines that ought to be in class CHARACTER_8
-- (From KL_IMPORTED_CHARACTER_ROUTINES)
-- Platform-dependent properties
-- (From KL_SHARED_PLATFORM)
-- Constant string "false"
-- (From STRING_8)
-- Position of first occurrence of other at or after start
-- with 0..fuzz mismatches between the string and other.
-- 0 if there are no fuzzy matches
-- (From STRING_8)
-- Does string share the text of other?
-- (From STRING_8)
-- Position of first occurrence of other at or after start_pos
-- and to or before end_pos;
-- 0 if none.
-- (From STRING_8)
-- Constant string "true"
-- (From STRING_8)
-- Routines that ought to be in class ANY
-- (From KL_IMPORTED_ANY_ROUTINES)
-- Routines that ought to be in class INTEGER_32
-- (From KL_IMPORTED_INTEGER_ROUTINES)
-- Index of first occurrence of unicode character with
-- code a_code at or after start_index; 0 if none
-- Index of first occurrence of c at or after start_index;
-- 0 if none
-- Character at index i;
-- '%U' if the unicode character at index
-- i cannot fit into a CHARACTER_8
-- (Extended from ELKS 2001 STRING_8)
-- Note: Use item_code instead of this routine when Current
-- can contain characters which may not fit into a CHARACTER_8.
-- (From KS_STRING)
-- Code of character at index i
-- (From KS_STRING)
-- New empty string with same dynamic type as Current
-- New object which is a clone of Current preceded
-- by the characters of other
-- New STRING_8 having the same character sequence as Current
-- where characters which do not fit in a CHARACTER_8 are
-- replaced by a '%U'
-- (Extended from ELKS 2001 STRING_8)
-- (From KS_STRING)
-- Index of first occurrence of other at or after start_index;
-- 0 if none. other and Current are considered with their
-- characters which do not fit in a CHARACTER_8 replaced by a '%U'
-- (Extended from ELKS 2001 STRING_8)
-- (From KS_STRING)
-- Unicode character at index i;
-- Return a new object at each call
-- Index of first occurrence of other at or after start_index;
-- 0 if none
-- UTF-32 encoding routines
-- (From UC_IMPORTED_UTF32_ROUTINES)
-- Proposed number of additional items
--| Result is a reasonable value, resulting from a space-time tradeoff.
-- (From RESIZABLE)
-- Percentage by which structure will grow automatically
-- (From RESIZABLE)
-- Minimal number of additional items
-- (From RESIZABLE)
-- Maximum number of bytes that can be put in
-- internal storage
-- (From STRING_GENERAL)
-- Number of bytes in internal storage
-- Number of times unicode character of code
-- a_code appears in the string
-- Number of times c appears in the string
-- Is current object less than or equal to other?
-- (From KS_COMPARABLE)
-- Is current object greater than other?
-- (From KS_COMPARABLE)
-- Is current object greater than or equal to other?
-- (From KS_COMPARABLE)
-- The greater of current object and other
-- (From KS_COMPARABLE)
-- The smaller of current object and other
-- (From KS_COMPARABLE)
-- Is string lexicographically lower than other?
-- (Extended from ELKS 2001 STRING_8, inherited from COMPARABLE)
-- (From KS_COMPARABLE)
-- Do Current and other have the same character sequence?
-- Current is considered with its characters which do not
-- fit in a CHARACTER_8 replaced by a '%U'.
-- (Extended from ELKS 2001 STRING_8)
-- (From KS_STRING)
-- Do Current and other have the same unicode character sequence?
-- If current object equal to other, 0;
-- if smaller, -1; if greater, 1
-- (ELKS 2001 STRING_8, inherited from COMPARABLE)
-- Note: there is a bug in the specification of the
-- contracts of three_way_comparison inherited
-- from COMPARABLE. This routine cannot satisfy
-- its postconditions if other is not of the
-- same type as Current because the postcondition
-- uses is_equal and is_equal has a postcondition
-- inherited from ANY which says if it returns true
-- then other has the same type as Current.
-- (From KS_COMPARABLE)
-- If current object equal to other, 0;
-- if smaller, -1; if greater, 1
-- Note: there is a bug in the specification of the
-- contracts of three_way_comparison inherited
-- from COMPARABLE. This routine cannot satisfy
-- its postconditions if other is not of the
-- same type as Current because the postcondition
-- uses is_equal and is_equal has a postcondition
-- inherited from ANY which says if it returns true
-- then other has the same type as Current.
-- three_way_unicode_comparison solves this problem
-- and make the comparison polymorphically safe by
-- changing the signature from 'like Current' to
-- 'STRING_8' and by using same_unicode_string instead
-- of is_equal in its postcondition.
-- Is string made of same character sequence as other regardless of casing
-- (possibly with a different capacity)?
-- (From STRING_8)
-- Is string lexicographically lower than other?
-- (From PART_COMPARABLE)
-- Is string made of same character sequence as other
-- (possibly with a different capacity)?
-- (From ANY)
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (From CONTAINER)
-- (From CONTAINER)
-- May new items be added? (Answer: yes.)
-- (From COLLECTION)
-- Does Current represent an INTEGER_32?
-- (From STRING_8)
-- Does Current represent an INTEGER_16?
-- (From STRING_8)
-- Does Current represent an INTEGER_32?
-- (From STRING_8)
-- Does Current represent an INTEGER_64?
-- (From STRING_8)
-- Does Current represent a NATURAL_32?
-- (From STRING_8)
-- Does Current represent a NATURAL_16?
-- (From STRING_8)
-- Does Current represent a NATURAL_32?
-- (From STRING_8)
-- Does Current represent a NATURAL_64?
-- (From STRING_8)
-- Current is a STRING_32 instance
-- (From STRING_GENERAL)
-- Current is not a STRING_8 instance
-- (From STRING_GENERAL)
-- Is Current convertible to STRING_8 without information loss?
-- (From STRING_GENERAL)
-- Is v a valid code for a CHARACTER_32?
-- (From STRING_GENERAL)
-- Does Current contain the unicode character of code a_code?
-- Does Current contain other?
-- other and Current are considered with their characters
-- which do not fit in a CHARACTER_8 replaced by a '%U'.
-- (Extented from ELKS 2001 STRING_8)
-- (From KS_STRING)
-- Does Current contain other?
-- May current object be hashed?
-- (True if it is not its type's default.)
-- (From HASHABLE)
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- has (v). However, descendants might be able to provide more
-- efficient implementations.)
-- (From COLLECTION)
-- Is structure empty?
-- (From STRING_GENERAL)
-- Can current output stream be closed?
-- (From KI_OUTPUT_STREAM)
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (From CONTAINER)
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (From CONTAINER)
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (From COLLECTION)
-- Append the string representation of b at end.
-- (From STRING_8)
-- Append the string representation of d at end.
-- (From STRING_8)
-- Append the string representation of i at end.
-- (From STRING_8)
-- Append the string representation of r at end.
-- (From STRING_8)
-- Append a copy of s at end.
-- (From STRING_GENERAL)
-- Append c at end.
-- (From COLLECTION)
-- Add s to left of position i in current string.
-- (From STRING_8)
ELKS 2001: use insert_string instead
-- Prepend the string representation of b at front.
-- (From STRING_8)
-- Prepend the string representation of d at front.
-- (From STRING_8)
-- Prepend the string representation of i at front.
-- (From STRING_8)
-- Prepend the string representation of r at front.
-- (From STRING_8)
-- Prepend a copy of s, if not void, at front.
-- (From STRING_8)
-- Replace all current characters with blanks.
-- (From STRING_8)
-- Copy characters of other within bounds start_pos and
-- end_pos to current string starting at index index_pos.
-- (From STRING_8)
-- Append unicode character of code a_code at end.
-- Append substring of a_string between indexes
-- s and e at end of current string.
-- (From KI_CHARACTER_OUTPUT_STREAM)
-- Replace every character with unicode character of code a_code.
-- Replace every character with unicode character c.
-- Insert unicode character of code a_code
-- at index i, shifting characters between
-- ranks i and count rightwards.
-- Insert unicode character c at index i, shifting
-- characters between ranks i and count rightwards.
-- Replace unicode character at index i
-- by unicode character of code a_code.
-- Replace unicode character at index i by c.
-- Replace the substring from start_index to end_index,
-- inclusive, with a_string.
-- Remove first occurrence of c, if any.
-- (From COLLECTION)
-- Remove all occurrences of c.
-- (From COLLECTION)
-- Remove all leading occurrences of c.
-- (From STRING_8)
-- Remove all trailing occurrences of c.
-- (From STRING_8)
-- Change the capacity to accommodate at least
-- Growth_percentage more items.
--| Trades space for time:
--| allocates fairly large chunks of memory but not very often.
-- (From RESIZABLE)
-- Ensure that the capacity is at least newsize.
-- (From RESIZABLE)
-- Rearrange string so that it can accommodate
-- at least newsize characters.
-- Do not lose any previously entered character.
-- (From STRING_GENERAL)
-- Convert Current as a STRING_32.
-- (From STRING_GENERAL)
-- Convert Current as a STRING_8. If a code of Current is
-- node a valid code for a STRING_8 it is replaced with the null
-- character.
-- (From STRING_GENERAL)
-- Create an instance of SYSTEM_STRING using characters
-- of Current between indices 1 and count.
-- (From STRING_GENERAL)
-- Convert Current as a STRING_32.
-- (From STRING_GENERAL)
-- Convert Current as a STRING_8.
-- (From STRING_GENERAL)
-- Justify a string based on a pivot
-- and the position it needs to be in
-- the final string.
-- This will grow the string if necessary
-- to get the pivot in the correct place.
-- (From STRING_8)
-- Representation as a linear structure
-- (From CONTAINER)
-- Boolean value;
-- "True" yields True, "False" yields False
-- (case-insensitive)
-- (From STRING_8)
-- Duplicate a string within itself
-- ("hello").multiply(3) => "hellohellohello"
-- (From STRING_8)
-- New object equal to Current
-- Try to close output stream if it is closable. Set
-- is_open_write to false if operation was successful.
-- (From KI_OUTPUT_STREAM)
-- Last byte_index requested
-- (Cache for 'i := i + 1' iterations and similar)
-- Last byte_index Result
-- (Cache for 'i := i + 1' iterations and similar)
-- Reset byte index (after write operation for example).
-- Original attribute values of mismatched object
-- (From MISMATCH_CORRECTOR)
-- Write a_string to output stream
-- followed by a line separator.
-- (From KI_TEXT_OUTPUT_STREAM)
-- Write a line separator to output stream.
-- (From KI_TEXT_OUTPUT_STREAM)
-- Read items of an_input_stream until the end
-- of input is reached, and write these items to
-- current output stream.
-- (From KI_OUTPUT_STREAM)
-- Write "True" to output stream if
-- b is true, "False" otherwise.
-- (From KI_CHARACTER_OUTPUT_STREAM)
-- Write decimal representation
-- of i to output stream.
-- Regexp: 0|(-?[1-9][0-9]*)
-- (From KI_CHARACTER_OUTPUT_STREAM)
-- String that should be displayed in debugger to represent Current.
-- (From DEBUG_OUTPUT)
-- Line separator
-- (From KI_TEXT_OUTPUT_STREAM)
-- Do nothing (operation does not apply to string).
-- (From KI_CHARACTER_OUTPUT_STREAM)
-- Can characters be written to output stream?
-- (From KI_OUTPUT_STREAM)
-- Byte index of character at index i
-- Character at byte_index i;
-- '%U' is the unicode character at byte index
-- i cannot fit into a CHARACTER_8
-- Is byte at index i the first byte of an encoded unicode character?
-- Code of character at byte index i
-- Byte index of unicode character after character
-- at byte index i; Return 'byte_count + 1' if
-- character at byte index i is the last character
-- in the string
-- Byte index of unicode character n positions after
-- character at byte index i; Return 'byte_count + 1'
-- if no such character in the string
-- Append unicode character c at end.
[020720] Use append_unicode_character instead.
-- Append a copy of a_string at end.
[011225] Use append_string instead.
-- Append unicode character c at end.
[020720] Use append_unicode_character instead.
-- Insert unicode character c at index i, shifting
-- characters between ranks i and count rightwards.
[020720] Use insert_unicode_character instead.
-- Platform-dependent properties
-- (From KL_SHARED_PLATFORM)
[040101] Use Platform instead.
-- Position of first occurrence of c at or after start_index;
-- 0 if none.
-- (From STRING_GENERAL)
-- Set count to number of characters.
-- (From STRING_GENERAL)
-- Move bytes at and after position i
-- by offset positions to the left.
-- Move bytes at and after position i
-- by offset positions to the right.
-- Resize space for n bytes.
-- Do not lose previously stored bytes.
Unicode strings