Unless specified otherwise, STRING and CHARACTER 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)
$Date: 2005/07/13 17:05:11 $
$Revision: 1.49 $
-- Create empty string, or remove all characters from
-- existing string.
-- (Extended from ELKS 2001 STRING)
-- (From KS_STRING)
-- Initialize from the character sequence of a_string.
-- (ELKS 2001 STRING)
-- (From KS_STRING)
-- Create string of length n filled with character c.
-- (ELKS 2001 STRING)
-- (From KS_STRING)
-- 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.
-- Create empty string, or remove all characters from
-- existing string.
-- (Extended from ELKS 2001 STRING)
-- (From KS_STRING)
-- Initialize from the character sequence of a_string.
-- (ELKS 2001 STRING)
-- (From KS_STRING)
-- Routines that ought to be in class ANY
-- (From KL_IMPORTED_ANY_ROUTINES)
-- Routines that ought to be in class CHARACTER
-- (From KL_IMPORTED_CHARACTER_ROUTINES)
-- Routines that ought to be in class INTEGER
-- (From KL_IMPORTED_INTEGER_ROUTINES)
-- Platform-dependent properties
-- (From KL_SHARED_PLATFORM)
-- Routines that ought to be in class STRING
-- (From KL_IMPORTED_STRING_ROUTINES)
-- Special data zone
-- (From TO_SPECIAL)
-- Index of first occurrence of character c
-- at or after start_index; 0 if none
-- (ELKS 2001 STRING)
-- (From KS_STRING)
-- 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
-- New object which is a clone of Current extended
-- by the characters of other
-- (ELKS 2001 STRING)
-- (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 having the same character sequence as Current
-- where characters which do not fit in a CHARACTER are
-- replaced by a '%U'
-- (Extended from ELKS 2001 STRING)
-- (From KS_STRING)
-- New object containing all characters
-- from start_index to end_index inclusive
-- (ELKS 2001 STRING)
-- (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 replaced by a '%U'
-- (Extended from ELKS 2001 STRING)
-- (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-16 encoding routines
-- (From UC_IMPORTED_UTF16_ROUTINES)
-- UTF-8 encoding routines
-- (From UC_IMPORTED_UTF8_ROUTINES)
-- Maximum number of bytes that can be put in
-- internal storage
-- (From BOUNDED)
-- Number of bytes in internal storage
-- Number of times unicode character of code
-- a_code appears in the string
-- Number of times character c appears in the string
-- (ELKS 2001 STRING)
-- (From KS_STRING)
-- Number of times c appears in the string
-- Is string lexicographically lower than other?
-- (Extended from ELKS 2001 STRING, inherited from COMPARABLE)
-- (From KS_COMPARABLE)
-- 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)
-- Is other attached to an object considered equal
-- to current object?
-- (Extended from ELKS 2001 STRING)
-- (From ANY)
-- The greater of current object and other
-- (From KS_COMPARABLE)
-- The smaller of current object and other
-- (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 replaced by a '%U'.
-- (Extended from ELKS 2001 STRING)
-- (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, 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' and by using same_unicode_string instead
-- of is_equal in its postcondition.
-- 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 replaced by a '%U'.
-- (Extented from ELKS 2001 STRING)
-- (From KS_STRING)
-- Does Current contain other?
-- Can current output stream be closed?
-- (From KI_OUTPUT_STREAM)
-- Is structure empty?
-- (From CONTAINER)
-- Append character c at end.
-- (ELKS 2001 STRING)
-- (From KS_STRING)
-- Append a copy of a_string at end.
-- (ELKS 2001 STRING)
-- (From KS_STRING)
-- Append substring of a_string between indexes
-- s and e at end of current string.
-- (From KI_CHARACTER_OUTPUT_STREAM)
-- Replace every character with character c.
-- (ELKS 2001 STRING)
-- (From KS_STRING)
-- 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 character c.
-- (ELKS 2001 STRING)
-- (From KS_STRING)
-- Replace unicode character at index i
-- by unicode character of code a_code.
-- Replace unicode character at index i by c.
-- Note: VE 4.1 has 'like Current' in its signature instead
-- of STRING as specified in ELKS 2001:
-- replace_substring (a_string: STRING; start_index, end_index: INTEGER) is
-- Replace the substring from start_index to end_index,
-- inclusive, with a_string.
-- (ELKS 2001 STRING)
-- (From KS_STRING)
-- Replace the substring from start_index to end_index,
-- inclusive, with a_string.
-- Remove all characters from start_index
-- to end_index inclusive.
-- (ELKS 2001 STRING)
-- (From KS_STRING)
-- New object with all letters in lower case
-- (Extended from ELKS 2001 STRING)
-- (From KS_STRING)
-- STRING version of current string;
-- Return the UTF8 representation if it is encoded
-- with UTF8, the UTF16 representation if it is
-- encoded with UTF16, etc.
-- New object with all letters in upper case
-- (Extended from ELKS 2001 STRING)
-- (From KS_STRING)
-- 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)
-- 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)
-- 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).
-- 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)
-- String that should be displayed in debugger to represent Current.
-- (From DEBUG_OUTPUT)
-- New STRING containing terse printable representation
-- of current object; Non-ascii characters are represented
-- with the %/code/ convention.
-- (ELKS 2001 STRING)
-- (From ANY)
-- 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)
-- 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)
-- 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
-- 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.
-- 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