Unless otherwise specified in their preconditions, %
%the features of this class can deal with UC_STRING %
%whenever a STRING is expected.
Gobo Eiffel Kernel Library
Copyright (c) 1999-2005, Eric Bezault and others
Eiffel Forum License v2 (see forum.txt)
$Date: 2005/06/04 19:43:26 $
$Revision: 1.29 $
-- Create an empty string. Try to allocate space
-- for at least n characters.
-- (ELKS 2001 STRING)
[040930] Use 'create Result.make (n)' instead.
-- Create a new string containing n characters.
-- (Not in ELKS 2001 STRING)
-- Create empty string.
-- (ELKS 2001 STRING)
[041001] Use 'create Result.make_empty' instead.
-- Create string of length n filled with c.
-- (ELKS 2001 STRING)
[041001] Use 'create Result.make_filled (c, n)' instead.
-- Initialize from the character sequence of s.
-- s is considered with its characters which do not fit
-- in a CHARACTER replaced by a '%U'.
-- (ELKS 2001 STRING)
-- Note: Use this routine instead of 'STRING.make_from_string (s)'
-- when s is of dynamic type other than STRING (e.g. UC_STRING)
-- because the class STRING provided with the Eiffel compilers
-- is not necessarily aware of the implementation of UC_STRING
-- and this may lead to run-time errors or crashes.
-- 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)
-- Platform-dependent properties
-- (From KL_SHARED_PLATFORM)
-- Hash code value of a_string which doesn't
-- take case sensitivity into account
-- (Not in ELKS 2001 STRING)
-- New object which contains the characters of a_string
-- followed by the characters of other; If other is
-- of dynamic type UC_STRING or one of its descendants and
-- a_string is not, then the dynamic type of the result
-- is the same as the dynamic type of other. Otherwise
-- the result is similar to 'a_string + other';
-- Note: Use this routine instead of 'a_string + other' or
-- 'a_string.append_string (other)' when a_string
-- can be of dynamic type STRING and other of dynamic
-- type other than STRING such as UC_STRING, because class
-- STRING provided by the Eiffel compilers is not necessarily
-- aware of the implementation of UC_STRING and this may
-- lead to run-time errors or crashes.
-- New empty string with same dynamic type as a_string;
-- Try to allocate space for at least n characters.
-- (Not in ELKS 2001 STRING)
-- New STRING having the same character sequence as a_string
-- where characters which do not fit in a CHARACTER are
-- replaced by a '%U'
-- (Extended from ELKS 2001 STRING)
[041001] Use 'a_string.string' instead.
-- New object containing all characters of a_string
-- from start_index to end_index inclusive
-- (ELKS 2001 STRING)
[040922] Use a_string.substring (start_index, end_index) instead.
-- Index of first occurrence of other at or after start_index in
-- a_string; 0 if none. a_string and other are considered with
-- their characters which do not fit in a CHARACTER replaced by a '%U'.
-- (ELKS 2001 STRING)
-- Note: Use this feature instead of 'a_string.substring_index (other,
-- start_index)' when a_string can be of dynamic type STRING and
-- other of dynamic type other than STRING such as UC_STRING, because
-- class STRING provided by the Eiffel compilers is not necessarily
-- aware of the implementation of UC_STRING and this may lead to
-- run-time errors or crashes.
-- Do a_string and other have the same character sequence?
-- a_string and other are considered with their characters
-- which do not fit in a CHARACTER replaced by a '%U'.
-- (Extended from ELKS 2001 STRING)
-- Note: Use this feature instead of 'a_string.same_string
-- (other)' when a_string can be of dynamic type STRING and
-- other of dynamic type other than STRING such as UC_STRING,
-- because class STRING provided by the Eiffel compilers is
-- not necessarily aware of the implementation of UC_STRING
-- and this may lead to run-time errors or crashes.
-- Are s1 and s2 made up of the same
-- characters (case insensitive)?
-- (Not in ELKS 2001 STRING)
-- Do a_string and other have the same unicode character sequence?
-- (Not in ELKS 2001 STRING)
-- Note: the difference with elks_same_string is that here the
-- implementation uses STRING.item_code instead of STRING.item
-- and hence characters which have different codes are not
-- considered equal even if they do not fit into a CHARACTER.
-- Do a_string and other have the same unicode character sequence?
-- Note: the difference with elks_same_string is that here the
-- implementation uses STRING.item_code instead of STRING.item
-- and hence characters which have different codes are not
-- considered equal even if they do not fit into a CHARACTER.
[020722] Use same_string instead.
-- If a_string equal to other, 0; if smaller, -1; if greater, 1
-- (case insensitive comparison)
-- (Not in ELKS 2001 STRING)
-- If a_string equal to other, 0;
-- if smaller, -1; if greater, 1
-- (ELKS 2001 STRING)
-- Note: there is a bug in the specification of the
-- contracts of three_way_comparison from class
-- 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. The current feature
-- three_way_comparison in class KL_STRING_ROTUINES
-- solves this problem and make the comparison
-- polymorphically safe by changing the signature
-- from 'like Current' to 'STRING' and by using
-- STRING_.same_string instead of is_equal in
-- its postcondition.
-- Does a_string contain other? a_string and other
-- are considered with their characters which do not fit
-- in a CHARACTER replaced by a '%U'.
-- (Extended from ELKS 2001 STRING)
-- Note: Use this feature instead of 'a_string.has_substring
-- (other)' when a_string can be of dynamic type STRING and
-- other of dynamic type other than STRING such as UC_STRING,
-- because class STRING provided by the Eiffel compilers is
-- not necessarily aware of the implementation of UC_STRING
-- and this may lead to run-time errors or crashes.
-- Is a string made up of digits or A-F or a-f?
-- (Not in ELKS 2001 STRING)
-- Is a_string only made up of digits?
-- Append substring of other between indexes
-- s and e at end of a_string.
-- If the dynamic type of other is UC_STRING or one of
-- its descendants and a_string is not, then return a
-- new object with the same dynamic type as other and
-- which contains the characters of a_string followed
-- by the characters of other. Otherwise append the
-- characters of other to a_string and return a_string.
-- Note: Use this routine instead of 'a_string.append_string (other)'
-- when a_string can be of dynamic type STRING and other
-- of dynamic type other than STRING such as UC_STRING, because
-- class STRING provided by the Eiffel compilers is not necessarily
-- aware of the implementation of UC_STRING and this may
-- lead to run-time errors or crashes.
-- If the dynamic type of other is UC_STRING or one of
-- its descendants and a_string is not, then return a
-- new object with the same dynamic type as other and
-- which contains the characters of a_string followed by
-- the characters of other between indexes s and e.
-- Otherwise append the characters of other between s
-- and e to a_string and return a_string.
-- Note: Use this routine instead of 'a_string.append_string
-- (other.substring (s, e)' when a_string can be of dynamic
-- type STRING and other of dynamic type other than STRING
-- such as UC_STRING, because class STRING provided by the
-- Eiffel compilers is not necessarily aware of the
-- implementation of UC_STRING and this may lead to run-time
-- errors or crashes.
-- Replace every character in a_string with c.
-- (ELKS 2001 STRING)
[041002] Use 'a_string.fill_with (c)' instead.
-- Insert c at index i in a_string, shifting characters
-- between ranks i and count rightwards.
-- (ELKS 2001 STRING)
[041002] Use 'a_string.insert_character (c)' instead.
-- Copy of a_text for which each occurrence of a_old has been replaced
-- by a_new; a_text if no occurrence could be found
-- Copy of a_text for which first occurrence of a_old has been replaced
-- by a_new; a_text if no occurrence could be found
-- If the dynamic type of other is UC_STRING or one of
-- its descendants and a_string is not, then return a
-- new object with the same dynamic type as other and
-- which contains the characters of a_string from which
-- the substring from start_index to end_index, inclusive,
-- has been replaced with other. Otherwise replace the
-- substring from start_index to end_index, inclusive,
-- in a_string with other and return a_string.
-- Note: Use this routine instead of 'a_string.replace_substring (other)'
-- when a_string can be of dynamic type STRING and other
-- of dynamic type other than STRING such as UC_STRING, because
-- class STRING provided by the Eiffel compilers is not necessarily
-- aware of the implementation of UC_STRING and this may
-- lead to run-time errors or crashes.
-- Remove all the characters of a_string except for the first n;
-- if n > a_string.count, do nothing.
-- (ELKS 2001 STRING)
[041002] Use a_string.keep_head (n) instead.
-- Remove all the characters of a_string except for the last n;
-- if n > a_string.count, do nothing.
-- (ELKS 2001 STRING)
[041002] Use a_string.keep_tail (n) instead.
-- Remove leading whitespace from a_string.
-- (Not in ELKS 2001 STRING)
-- Note: SE 1.1 removes the following characters: ' ';
-- ISE 5.4 removes the following characters: ' ', '%T', '%R', '%N';
-- VE 4.1 removes the characters <= ' '.
-- Remove the first n characters of a_string;
-- if n > a_string.count, remove all.
-- (ELKS 2001 STRING)
[041002] Use a_string.remove_head (n) instead.
-- Remove all characters of a_string from start_index
-- to end_index inclusive.
-- (ELKS 2001 STRING)
[041002] Use a_string.remove_substring (start_index, end_index) instead.
-- Remove the last n characters of a_string;
-- if n > a_string.count, remove all.
-- (ELKS 2001 STRING)
[041002] Use a_string.remove_tail (n) instead.
-- Remove trailing whitespace from a_string.
-- (Not in ELKS 2001 STRING)
-- Note: SE 1.1 removes the following characters: ' ';
-- ISE 5.4 removes the following characters: ' ', '%T', '%R', '%N';
-- VE 4.1 removes the characters <= ' '.
-- Remove all characters in a_string.
-- Do not discard allocated memory (i.e. do not
-- change capacity) when allowed by the underlying
-- Eiffel compiler.
-- Note: currently only ISE and SE will not change
-- capacity, whereas VE will reset capacity to zero.
-- Resize a_string so that it contains n characters.
-- Do not lose any previously entered characters.
-- New object with all letters in lower case
-- (Extended from ELKS 2001 STRING)
[041004] Use 'a_string.as_lower' instead.
-- String version of a_string;
-- Return a_string if it is of dynamic type STRING,
-- return the UTF encoding version if it is a descendant
-- of UC_STRING, return 'string (a_string)' otherwise.
-- New object with all letters in upper case
-- (Extended from ELKS 2001 STRING)
[041004] Use 'a_string.as_upper' instead.
-- Convert hexadecimal number string to integer;
-- (Not in ELKS 2001 STRING)
-- Note: Do not take overflow into account.
-- Lower case version of a_string
-- (Do not alter a_string.)
[041004] Use 'a_string.as_lower' instead.
-- Upper case version of a_string
-- (Do not alter a_string.)
[041004] Use 'a_string.as_upper' instead.
-- Clone of a_string
-- Platform-dependent properties
-- (From KL_SHARED_PLATFORM)
[040101] Use Platform instead.
Routines that ought to be in class STRING