Automatic generation produced by ISE Eiffel
note description: "Common ancestors to all immutable STRING classes." library: "Free implementation of ELKS library" status: "See notice at end of class." legal: "See notice at end of class." date: "$Date: 2020-05-12 12:58:01 -0800 (Tue, 12 May 2020) $" revision: "$Revision: 104181 $" deferred class interface IMMUTABLE_STRING_GENERAL convert as_string_32: {READABLE_STRING_32, STRING_32} feature -- Access case_insensitive_hash_code: INTEGER_32 -- Hash code value of the lower case version of Current. -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL consistent: Result = as_lower.case_insensitive_hash_code code (i: INTEGER_32): NATURAL_32 -- Code at position i -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL valid_index: valid_index (i) False_constant: STRING_8 = "false" -- Constant string "false" -- (from READABLE_STRING_GENERAL) generating_type: TYPE [detachable IMMUTABLE_STRING_GENERAL] -- Type of current object -- (type of which it is a direct instance) -- (from ANY) ensure -- from ANY generating_type_not_void: Result /= Void generator: STRING_8 -- Name of current object's generating class -- (base class of the type of which it is a direct instance) -- (from ANY) ensure -- from ANY generator_not_void: Result /= Void generator_not_empty: not Result.is_empty hash_code: INTEGER_32 -- Hash code value -- (from READABLE_STRING_GENERAL) ensure -- from HASHABLE good_hash_value: Result >= 0 index_of (c: like item; start_index: INTEGER_32): INTEGER_32 -- Position of first occurrence of c at or after start_index; -- 0 if none. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL start_large_enough: start_index >= 1 start_small_enough: start_index <= count + 1 ensure -- from READABLE_STRING_GENERAL valid_result: Result = 0 or (start_index <= Result and Result <= count) zero_if_absent: (Result = 0) = not substring (start_index, count).has (c) found_if_present: substring (start_index, count).has (c) implies item (Result) = c none_before: substring (start_index, count).has (c) implies not substring (start_index, Result - 1).has (c) index_of_code (c: like code; start_index: INTEGER_32): INTEGER_32 -- Position of first occurrence of c at or after start_index; -- 0 if none. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL start_large_enough: start_index >= 1 start_small_enough: start_index <= count + 1 ensure -- from READABLE_STRING_GENERAL valid_result: Result = 0 or (start_index <= Result and Result <= count) zero_if_absent: (Result = 0) = not substring (start_index, count).has_code (c) found_if_present: substring (start_index, count).has_code (c) implies code (Result) = c none_before: substring (start_index, count).has_code (c) implies not substring (start_index, Result - 1).has_code (c) item alias "[]" (i: INTEGER_32): CHARACTER_32 -- Character at position i. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL valid_index: valid_index (i) last_index_of (c: like item; start_index_from_end: INTEGER_32): INTEGER_32 -- Position of last occurrence of c. -- 0 if none. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL start_index_small_enough: start_index_from_end <= count start_index_large_enough: start_index_from_end >= 1 ensure -- from READABLE_STRING_GENERAL valid_result: 0 <= Result and Result <= start_index_from_end zero_if_absent: (Result = 0) = not substring (1, start_index_from_end).has (c) found_if_present: substring (1, start_index_from_end).has (c) implies item (Result) = c none_after: substring (1, start_index_from_end).has (c) implies not substring (Result + 1, start_index_from_end).has (c) last_index_of_code (c: like code; start_index_from_end: INTEGER_32): INTEGER_32 -- Position of last occurrence of c. -- 0 if none. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL start_index_small_enough: start_index_from_end <= count start_index_large_enough: start_index_from_end >= 1 ensure -- from READABLE_STRING_GENERAL valid_result: 0 <= Result and Result <= start_index_from_end zero_if_absent: (Result = 0) = not substring (1, start_index_from_end).has_code (c) found_if_present: substring (1, start_index_from_end).has_code (c) implies code (Result) = c none_after: substring (1, start_index_from_end).has_code (c) implies not substring (Result + 1, start_index_from_end).has_code (c) True_constant: STRING_8 = "true" -- Constant string "true" -- (from READABLE_STRING_GENERAL) feature -- Measurement capacity: INTEGER_32 -- Number of characters allocated in Current -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL capacity_non_negative: Result >= 0 count: INTEGER_32 -- Number of characters in Current -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL count_non_negative: Result >= 0 occurrences (c: CHARACTER_32): INTEGER_32 -- Number of times c appears in the string -- (from READABLE_STRING_GENERAL) ensure then -- from READABLE_STRING_GENERAL zero_if_empty: count = 0 implies Result = 0 recurse_if_not_found_at_first_position: (count > 0 and then item (1) /= c) implies Result = substring (2, count).occurrences (c) recurse_if_found_at_first_position: (count > 0 and then item (1) = c) implies Result = 1 + substring (2, count).occurrences (c) feature -- Comparison frozen deep_equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are a and b either both void -- or attached to isomorphic object structures? -- (from ANY) ensure -- from ANY instance_free: class shallow_implies_deep: standard_equal (a, b) implies Result both_or_none_void: (a = Void) implies (Result = (b = Void)) same_type: (Result and (a /= Void)) implies (b /= Void and then a.same_type (b)) symmetric: Result implies deep_equal (b, a) ends_with (s: READABLE_STRING_GENERAL): BOOLEAN -- Does string finish with s? -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL argument_not_void: s /= Void ensure -- from READABLE_STRING_GENERAL definition: Result = s.same_string (substring (count - s.count + 1, count)) frozen equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are a and b either both void or attached -- to objects considered equal? -- (from ANY) ensure -- from ANY instance_free: class definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.is_equal (b)) fuzzy_index (other: READABLE_STRING_GENERAL; start: INTEGER_32; fuzz: INTEGER_32): INTEGER_32 -- 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 READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL other_exists: other /= Void other_not_empty: not other.is_empty start_large_enough: start >= 1 start_small_enough: start <= count acceptable_fuzzy: fuzz <= other.count has_substring (other: READABLE_STRING_GENERAL): BOOLEAN -- Does Current contain other? -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL other_not_void: other /= Void ensure -- from READABLE_STRING_GENERAL false_if_too_small: count < other.count implies not Result true_if_initial: (count >= other.count and then other.same_string (substring (1, other.count))) implies Result recurse: (count >= other.count and then not other.same_string (substring (1, other.count))) implies (Result = substring (2, count).has_substring (other)) is_case_insensitive_equal (other: READABLE_STRING_GENERAL): BOOLEAN -- Is string made of same character sequence as other regardless of casing -- (possibly with a different capacity)? -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL symmetric: Result implies other.is_case_insensitive_equal (Current) consistent: attached {IMMUTABLE_STRING_GENERAL} other as l_other implies (standard_is_equal (l_other) implies Result) valid_result: as_lower ~ other.as_lower implies Result frozen is_deep_equal alias "≡≡≡" (other: IMMUTABLE_STRING_GENERAL): BOOLEAN -- Are Current and other attached to isomorphic object structures? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY shallow_implies_deep: standard_is_equal (other) implies Result same_type: Result implies same_type (other) symmetric: Result implies other.is_deep_equal (Current) is_equal (other: IMMUTABLE_STRING_GENERAL): BOOLEAN -- Is other attached to an object of the same type -- as current object and identical to it? -- (from COMPARABLE) require -- from ANY other_not_void: other /= Void ensure -- from ANY symmetric: Result implies other ~ Current consistent: standard_is_equal (other) implies Result ensure then -- from COMPARABLE trichotomy: Result = (not (Current < other) and not (other < Current)) is_greater alias ">" (other: IMMUTABLE_STRING_GENERAL): BOOLEAN -- Is current object greater than other? -- (from COMPARABLE) require -- from PART_COMPARABLE other_exists: other /= Void ensure then -- from COMPARABLE definition: Result = (other < Current) is_greater_equal alias ">=" alias "≥" (other: IMMUTABLE_STRING_GENERAL): BOOLEAN -- Is current object greater than or equal to other? -- (from COMPARABLE) require -- from PART_COMPARABLE other_exists: other /= Void ensure then -- from COMPARABLE definition: Result = (other <= Current) is_less alias "<" (other: IMMUTABLE_STRING_GENERAL): BOOLEAN -- Is current object less than other? -- (from COMPARABLE) require -- from PART_COMPARABLE other_exists: other /= Void ensure then -- from COMPARABLE asymmetric: Result implies not (other < Current) is_less_equal alias "<=" alias "≤" (other: IMMUTABLE_STRING_GENERAL): BOOLEAN -- Is current object less than or equal to other? -- (from COMPARABLE) require -- from PART_COMPARABLE other_exists: other /= Void ensure then -- from COMPARABLE definition: Result = ((Current < other) or (Current ~ other)) max alias "∨" (other: IMMUTABLE_STRING_GENERAL): IMMUTABLE_STRING_GENERAL -- The greater of current object and other -- (from COMPARABLE) require -- from COMPARABLE other_exists: other /= Void ensure -- from COMPARABLE current_if_not_smaller: Current >= other implies Result = Current other_if_smaller: Current < other implies Result = other min alias "∧" (other: IMMUTABLE_STRING_GENERAL): IMMUTABLE_STRING_GENERAL -- The smaller of current object and other -- (from COMPARABLE) require -- from COMPARABLE other_exists: other /= Void ensure -- from COMPARABLE current_if_not_greater: Current <= other implies Result = Current other_if_greater: Current > other implies Result = other same_caseless_characters (other: READABLE_STRING_GENERAL; start_pos, end_pos, index_pos: INTEGER_32): BOOLEAN -- Are characters of other within bounds start_pos and end_pos -- caseless identical to characters of current string starting at index index_pos. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL other_not_void: other /= Void valid_start_pos: other.valid_index (start_pos) valid_end_pos: other.valid_index (end_pos) valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1) valid_index_pos: valid_index (index_pos) ensure -- from READABLE_STRING_GENERAL same_characters: Result = substring (index_pos, index_pos + end_pos - start_pos).is_case_insensitive_equal (other.substring (start_pos, end_pos)) same_characters (other: READABLE_STRING_GENERAL; start_pos, end_pos, index_pos: INTEGER_32): BOOLEAN -- Are characters of other within bounds start_pos and end_pos -- identical to characters of current string starting at index index_pos. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL other_not_void: other /= Void valid_start_pos: other.valid_index (start_pos) valid_end_pos: other.valid_index (end_pos) valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1) valid_index_pos: valid_index (index_pos) ensure -- from READABLE_STRING_GENERAL same_characters: Result = substring (index_pos, index_pos + end_pos - start_pos).same_string (other.substring (start_pos, end_pos)) same_string (other: READABLE_STRING_GENERAL): BOOLEAN -- Does other represent the same string as Current? -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL other_not_void: other /= Void frozen standard_equal (a: detachable ANY; b: like arg #1): BOOLEAN -- Are a and b either both void or attached to -- field-by-field identical objects of the same type? -- Always uses default object comparison criterion. -- (from ANY) ensure -- from ANY instance_free: class definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.standard_is_equal (b)) frozen standard_is_equal alias "≜" (other: IMMUTABLE_STRING_GENERAL): BOOLEAN -- Is other attached to an object of the same type -- as current object, and field-by-field identical to it? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY same_type: Result implies same_type (other) symmetric: Result implies other.standard_is_equal (Current) starts_with (s: READABLE_STRING_GENERAL): BOOLEAN -- Does string begin with s? -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL argument_not_void: s /= Void ensure -- from READABLE_STRING_GENERAL definition: Result = s.same_string (substring (1, s.count)) substring_index (other: READABLE_STRING_GENERAL; start_index: INTEGER_32): INTEGER_32 -- Index of first occurrence of other at or after start_index; -- 0 if none -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL other_not_void: other /= Void valid_start_index: start_index >= 1 and start_index <= count + 1 ensure -- from READABLE_STRING_GENERAL valid_result: Result = 0 or else (start_index <= Result and Result <= count - other.count + 1) zero_if_absent: (Result = 0) = not substring (start_index, count).has_substring (other) at_this_index: Result >= start_index implies other.same_string (substring (Result, Result + other.count - 1)) none_before: Result > start_index implies not substring (start_index, Result + other.count - 2).has_substring (other) substring_index_in_bounds (other: READABLE_STRING_GENERAL; start_pos, end_pos: INTEGER_32): INTEGER_32 -- Position of first occurrence of other at or after start_pos -- and to or before end_pos; -- 0 if none. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL other_nonvoid: other /= Void other_notempty: not other.is_empty start_pos_large_enough: start_pos >= 1 start_pos_small_enough: start_pos <= count end_pos_large_enough: end_pos >= start_pos end_pos_small_enough: end_pos <= count ensure -- from READABLE_STRING_GENERAL correct_place: Result > 0 implies other.same_string (substring (Result, Result + other.count - 1)) three_way_comparison alias "⋚" (other: IMMUTABLE_STRING_GENERAL): INTEGER_32 -- If current object equal to other, 0; -- if smaller, -1; if greater, 1 -- (from COMPARABLE) require -- from COMPARABLE other_exists: other /= Void ensure -- from COMPARABLE equal_zero: (Result = 0) = (Current ~ other) smaller_negative: (Result = -1) = (Current < other) greater_positive: (Result = 1) = (Current > other) feature -- Status report conforms_to (other: ANY): BOOLEAN -- Does type of current object conform to type -- of other (as per Eiffel: The Language, chapter 13)? -- (from ANY) require -- from ANY other_not_void: other /= Void has (c: like item): BOOLEAN -- Does string include c? -- (from READABLE_STRING_GENERAL) ensure then -- from READABLE_STRING_GENERAL false_if_empty: count = 0 implies not Result true_if_first: count > 0 and then item (1) = c implies Result recurse: (count > 0 and then item (1) /= c) implies (Result = substring (2, count).has (c)) has_code (c: like code): BOOLEAN -- Does string include c? -- (from READABLE_STRING_GENERAL) ensure then -- from READABLE_STRING_GENERAL false_if_empty: count = 0 implies not Result true_if_first: count > 0 and then code (1) = c implies Result recurse: (count > 0 and then code (1) /= c) implies (Result = substring (2, count).has_code (c)) is_boolean: BOOLEAN -- Does Current represent a BOOLEAN? -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL is_boolean: Result = (True_constant.same_string_general (as_lower) or False_constant.same_string_general (as_lower)) is_double: BOOLEAN -- Does Current represent a REAL_64? -- Was declared in {READABLE_STRING_GENERAL} as synonym of `is_real_64`. -- (from READABLE_STRING_GENERAL) is_empty: BOOLEAN -- Is structure empty? -- (from READABLE_STRING_GENERAL) is_hashable: BOOLEAN -- May current object be hashed? -- (True by default.) -- (from HASHABLE) Is_immutable: BOOLEAN = True -- Can the character sequence of Current be not changed? is_integer: BOOLEAN -- Does Current represent an INTEGER_32? -- Was declared in {READABLE_STRING_GENERAL} as synonym of `is_integer_32`. -- (from READABLE_STRING_GENERAL) is_integer_16: BOOLEAN -- Does Current represent an INTEGER_16? -- (from READABLE_STRING_GENERAL) is_integer_32: BOOLEAN -- Does Current represent an INTEGER_32? -- Was declared in {READABLE_STRING_GENERAL} as synonym of `is_integer`. -- (from READABLE_STRING_GENERAL) is_integer_64: BOOLEAN -- Does Current represent an INTEGER_64? -- (from READABLE_STRING_GENERAL) is_integer_8: BOOLEAN -- Does Current represent an INTEGER_8? -- (from READABLE_STRING_GENERAL) is_natural: BOOLEAN -- Does Current represent a NATURAL_32? -- Was declared in {READABLE_STRING_GENERAL} as synonym of `is_natural_32`. -- (from READABLE_STRING_GENERAL) is_natural_16: BOOLEAN -- Does Current represent a NATURAL_16? -- (from READABLE_STRING_GENERAL) is_natural_32: BOOLEAN -- Does Current represent a NATURAL_32? -- Was declared in {READABLE_STRING_GENERAL} as synonym of `is_natural`. -- (from READABLE_STRING_GENERAL) is_natural_64: BOOLEAN -- Does Current represent a NATURAL_64? -- (from READABLE_STRING_GENERAL) is_natural_8: BOOLEAN -- Does Current represent a NATURAL_8? -- (from READABLE_STRING_GENERAL) is_number_sequence: BOOLEAN -- Does Current represent a number sequence? -- (from READABLE_STRING_GENERAL) is_real: BOOLEAN -- Does Current represent a REAL_32? -- Was declared in {READABLE_STRING_GENERAL} as synonym of `is_real_32`. -- (from READABLE_STRING_GENERAL) is_real_32: BOOLEAN -- Does Current represent a REAL_32? -- Was declared in {READABLE_STRING_GENERAL} as synonym of `is_real`. -- (from READABLE_STRING_GENERAL) is_real_64: BOOLEAN -- Does Current represent a REAL_64? -- Was declared in {READABLE_STRING_GENERAL} as synonym of `is_double`. -- (from READABLE_STRING_GENERAL) is_real_sequence: BOOLEAN -- Does Current represent a real sequence? -- (from READABLE_STRING_GENERAL) is_string_32: BOOLEAN -- Is Current a sequence of CHARACTER_32? -- (from READABLE_STRING_GENERAL) is_string_8: BOOLEAN -- Is Current a sequence of CHARACTER_8? -- (from READABLE_STRING_GENERAL) is_substring_whitespace (start_index, end_index: INTEGER_32): BOOLEAN -- Is substring between start_index and end_index containing only whitespace characters? -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL start_index_big_enough: 1 <= start_index end_index_small_enough: end_index <= count consistent_indexes: start_index - 1 <= end_index is_valid_as_string_8: BOOLEAN -- Is Current convertible to a sequence of CHARACTER_8 without information loss? -- (from READABLE_STRING_GENERAL) is_whitespace: BOOLEAN -- Is structure containing only whitespace characters? -- (from READABLE_STRING_GENERAL) same_type (other: ANY): BOOLEAN -- Is type of current object identical to type of other? -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY definition: Result = (conforms_to (other) and other.conforms_to (Current)) valid_code (v: like code): BOOLEAN -- Is v a valid code for Current? -- (from READABLE_STRING_GENERAL) valid_index (i: INTEGER_32): BOOLEAN -- Is i within the bounds of the string? -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL definition: Result = (1 <= i and i <= count) feature -- Conversion as_lower: IMMUTABLE_STRING_GENERAL -- New object with all letters in lower case. -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL as_lower_attached: Result /= Void length: Result.count = count anchor: count > 0 implies Result.item (1) = item (1).as_lower recurse: count > 1 implies Result.substring (2, count) ~ substring (2, count).as_lower as_string_32: STRING_32 -- Convert Current as a STRING_32. -- Was declared in {READABLE_STRING_GENERAL} as synonym of `to_string_32`. -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL as_string_32_not_void: Result /= Void identity: (conforms_to (create {STRING_32}.make_empty end) and Result = Current) or (not conforms_to (create {STRING_32}.make_empty end) and Result /= Current) as_upper: IMMUTABLE_STRING_GENERAL -- New object with all letters in upper case -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL as_upper_attached: Result /= Void length: Result.count = count anchor: count > 0 implies Result.item (1) = item (1).as_upper recurse: count > 1 implies Result.substring (2, count) ~ substring (2, count).as_upper split (a_separator: CHARACTER_32): LIST [IMMUTABLE_STRING_GENERAL] -- Split on a_separator. -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL Result /= Void to_boolean: BOOLEAN -- Boolean value; -- "True" yields True, "False" yields False -- (case-insensitive) -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_boolean: is_boolean ensure -- from READABLE_STRING_GENERAL to_boolean: (Result = as_lower.same_string (True_constant)) or (not Result = as_lower.same_string (False_constant)) frozen to_cil: SYSTEM_STRING -- Create an instance of SYSTEM_STRING using characters -- of Current between indices 1 and `count`. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_dotnet: {PLATFORM}.is_dotnet ensure -- from READABLE_STRING_GENERAL to_cil_not_void: Result /= Void to_double: REAL_64 -- "Double" value; -- for example, when applied to "123.0", will yield 123.0 (double) -- Was declared in {READABLE_STRING_GENERAL} as synonym of `to_real_64`. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL represents_a_double: is_double to_integer: INTEGER_32 -- 32-bit integer value -- Was declared in {READABLE_STRING_GENERAL} as synonym of `to_integer_32`. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_integer: is_integer_32 to_integer_16: INTEGER_16 -- 16-bit integer value -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_integer_16: is_integer_16 to_integer_32: INTEGER_32 -- 32-bit integer value -- Was declared in {READABLE_STRING_GENERAL} as synonym of `to_integer`. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_integer: is_integer_32 to_integer_64: INTEGER_64 -- 64-bit integer value -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_integer_64: is_integer_64 to_integer_8: INTEGER_8 -- 8-bit integer value -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_integer_8: is_integer_8 to_natural: NATURAL_32 -- 32-bit natural value -- Was declared in {READABLE_STRING_GENERAL} as synonym of `to_natural_32`. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_natural: is_natural_32 to_natural_16: NATURAL_16 -- 16-bit natural value -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_natural_16: is_natural_16 to_natural_32: NATURAL_32 -- 32-bit natural value -- Was declared in {READABLE_STRING_GENERAL} as synonym of `to_natural`. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_natural: is_natural_32 to_natural_64: NATURAL_64 -- 64-bit natural value -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_natural_64: is_natural_64 to_natural_8: NATURAL_8 -- 8-bit natural value -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_natural_8: is_natural_8 to_real: REAL_32 -- Real value; -- for example, when applied to "123.0", will yield 123.0 -- Was declared in {READABLE_STRING_GENERAL} as synonym of `to_real_32`. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL represents_a_real: is_real to_real_32: REAL_32 -- Real value; -- for example, when applied to "123.0", will yield 123.0 -- Was declared in {READABLE_STRING_GENERAL} as synonym of `to_real`. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL represents_a_real: is_real to_real_64: REAL_64 -- "Double" value; -- for example, when applied to "123.0", will yield 123.0 (double) -- Was declared in {READABLE_STRING_GENERAL} as synonym of `to_double`. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL represents_a_double: is_double to_string_32: STRING_32 -- Convert Current as a STRING_32. -- Was declared in {READABLE_STRING_GENERAL} as synonym of `as_string_32`. -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL as_string_32_not_void: Result /= Void identity: (conforms_to (create {STRING_32}.make_empty end) and Result = Current) or (not conforms_to (create {STRING_32}.make_empty end) and Result /= Current) to_string_8: STRING_8 -- Convert Current as a STRING_8. -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL is_valid_as_string_8: is_valid_as_string_8 ensure -- from READABLE_STRING_GENERAL as_string_8_not_void: Result /= Void identity: (conforms_to ("") and Result = Current) or (not conforms_to ("") and Result /= Current) feature -- Duplication copy (other: IMMUTABLE_STRING_GENERAL) -- Update current object using fields of object attached -- to other, so as to yield equal objects. -- (from ANY) require -- from ANY other_not_void: other /= Void type_identity: same_type (other) ensure -- from ANY is_equal: Current ~ other frozen deep_copy (other: IMMUTABLE_STRING_GENERAL) -- Effect equivalent to that of: -- `copy` (other . `deep_twin`) -- (from ANY) require -- from ANY other_not_void: other /= Void ensure -- from ANY deep_equal: deep_equal (Current, other) frozen deep_twin: IMMUTABLE_STRING_GENERAL -- New object structure recursively duplicated from Current. -- (from ANY) ensure -- from ANY deep_twin_not_void: Result /= Void deep_equal: deep_equal (Current, Result) head (n: INTEGER_32): IMMUTABLE_STRING_GENERAL -- Prefix, retaining first n characters (or as many as available). -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL non_negative_argument: n >= 0 ensure -- from READABLE_STRING_GENERAL same_count: count = old count new_count: Result.count = n.min (count) frozen standard_copy (other: IMMUTABLE_STRING_GENERAL) -- Copy every field of other onto corresponding field -- of current object. -- (from ANY) require -- from ANY other_not_void: other /= Void type_identity: same_type (other) ensure -- from ANY is_standard_equal: standard_is_equal (other) frozen standard_twin: IMMUTABLE_STRING_GENERAL -- New object field-by-field identical to other. -- Always uses default copying semantics. -- (from ANY) ensure -- from ANY standard_twin_not_void: Result /= Void equal: standard_equal (Result, Current) substring (start_index, end_index: INTEGER_32): IMMUTABLE_STRING_GENERAL -- Copy of substring containing all characters at indices -- between start_index and end_index -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL substring_not_void: Result /= Void substring_count: Result.count = end_index - start_index + 1 or Result.count = 0 first_code: Result.count > 0 implies Result.item (1) = item (start_index) recurse: Result.count > 0 implies Result.substring (2, Result.count) ~ substring (start_index + 1, end_index) tail (n: INTEGER_32): IMMUTABLE_STRING_GENERAL -- Suffix, retaining last n characters (or as many as available). -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL non_negative_argument: n >= 0 ensure -- from READABLE_STRING_GENERAL same_count: count = old count new_count: Result.count = n.min (count) frozen twin: IMMUTABLE_STRING_GENERAL -- New object equal to Current -- `twin` calls `copy`; to change copying/twinning semantics, redefine `copy`. -- (from ANY) ensure -- from ANY twin_not_void: Result /= Void is_equal: Result ~ Current feature -- Basic operations frozen default: detachable IMMUTABLE_STRING_GENERAL -- Default value of object's type -- (from ANY) frozen default_pointer: POINTER -- Default value of type POINTER -- (Avoid the need to write p.`default` for -- some p of type POINTER.) -- (from ANY) ensure -- from ANY instance_free: class default_rescue -- Process exception for routines with no Rescue clause. -- (Default: do nothing.) -- (from ANY) frozen do_nothing -- Execute a null action. -- (from ANY) ensure -- from ANY instance_free: class feature -- Access: Cursor new_character_32_cursor: STRING_ITERATION_CURSOR -- Fresh cursor for this string that iterates over code points (see `code`) -- exposed as {CHARACTER_32}. -- (from READABLE_STRING_GENERAL) feature -- Output Io: STD_FILES -- Handle to standard file setup -- (from ANY) ensure -- from ANY instance_free: class io_not_void: Result /= Void out: STRING_8 -- New string containing terse printable representation -- of current object -- (from ANY) ensure -- from ANY out_not_void: Result /= Void print (o: detachable ANY) -- Write terse external representation of o -- on standard output. -- (from ANY) ensure -- from ANY instance_free: class frozen tagged_out: STRING_8 -- New string containing terse printable representation -- of current object -- (from ANY) ensure -- from ANY tagged_out_not_void: Result /= Void feature -- Platform Operating_environment: OPERATING_ENVIRONMENT -- Objects available from the operating system -- (from ANY) ensure -- from ANY instance_free: class operating_environment_not_void: Result /= Void invariant immutable: Is_immutable -- from COMPARABLE irreflexive_comparison: not (Current < Current) -- from ANY reflexive_equality: standard_is_equal (Current) reflexive_conformance: conforms_to (Current) note copyright: "Copyright (c) 1984-2020, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class IMMUTABLE_STRING_GENERAL -- Generated by Eiffel Studio --
For more details: eiffel.org