Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Chart Relations Flat contracts Go to:
note description: "[ Sequences of 32-bit characters, accessible through integer indices in a contiguous range. ]" library: "Free implementation of ELKS library" status: "See notice at end of class." legal: "See notice at end of class." date: "$Date: 2012-05-23 21:13:10 -0700 (Wed, 23 May 2012) $" revision: "$Revision: 559 $" class interface STRING_32 create make (n: INTEGER_32) -- Allocate space for at least `n' characters. -- (from READABLE_STRING_32) require -- from READABLE_STRING_GENERAL non_negative_size: n >= 0 ensure -- from READABLE_STRING_GENERAL empty_string: count = 0 area_allocated: capacity >= n make_empty -- Create empty string. -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL empty: count = 0 area_allocated: capacity >= 0 make_filled (c: CHARACTER_32; n: INTEGER_32) -- Create string of length `n' filled with `c'. -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 valid_count: n >= 0 ensure -- from READABLE_STRING_32 count_set: count = n area_allocated: capacity >= n filled: occurrences (c) = count make_from_string (s: READABLE_STRING_32) -- Initialize from the characters of `s'. -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 string_exists: s /= Void ensure -- from READABLE_STRING_32 not_shared_implementation: Current /= s implies not shared_with (s) initialized: same_string (s) make_from_c (c_string: POINTER) -- Initialize from contents of `c_string', -- a string created by some C function -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 c_string_exists: c_string /= default_pointer make_from_c_pointer (c_string: POINTER) -- Create new instance from contents of `c_string', -- a string created by some C function -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 c_string_exists: c_string /= default_pointer make_from_cil (a_system_string: detachable SYSTEM_STRING) -- Initialize Current with `a_system_string'. require -- from READABLE_STRING_32 is_dotnet: {PLATFORM}.is_dotnet make_from_separate (other: READABLE_STRING_32) -- Initialize current string from `other'. -- (from READABLE_STRING_32) convert make_from_separate: {SYSTEM_STRING}, make_from_separate ({SYSTEM_STRING}), make_from_separate: {READABLE_STRING_8, STRING_8} feature -- Initialization adapt (s: STRING_32): like Current -- Object of a type conforming to the type of `s', -- initialized with attributes from `s' ensure adapt_not_void: Result /= Void shared_implementation: Result.shared_with (s) from_c (c_string: POINTER) -- Reset contents of string from contents of `c_string', -- a string created by some C function. require c_string_exists: c_string /= default_pointer ensure no_zero_byte: not has ('%U'.to_character_32) from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER_32) -- Reset contents of string from substring of `c_string', -- a string created by some C function. require c_string_exists: c_string /= default_pointer start_position_big_enough: start_pos >= 1 end_position_big_enough: start_pos <= end_pos + 1 ensure valid_count: count = end_pos - start_pos + 1 make (n: INTEGER_32) -- Allocate space for at least `n' characters. -- (from READABLE_STRING_32) require -- from READABLE_STRING_GENERAL non_negative_size: n >= 0 ensure -- from READABLE_STRING_GENERAL empty_string: count = 0 area_allocated: capacity >= n make_empty -- Create empty string. -- (from READABLE_STRING_GENERAL) ensure -- from READABLE_STRING_GENERAL empty: count = 0 area_allocated: capacity >= 0 make_filled (c: CHARACTER_32; n: INTEGER_32) -- Create string of length `n' filled with `c'. -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 valid_count: n >= 0 ensure -- from READABLE_STRING_32 count_set: count = n area_allocated: capacity >= n filled: occurrences (c) = count make_from_c (c_string: POINTER) -- Initialize from contents of `c_string', -- a string created by some C function -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 c_string_exists: c_string /= default_pointer make_from_cil (a_system_string: detachable SYSTEM_STRING) -- Initialize Current with `a_system_string'. require -- from READABLE_STRING_32 is_dotnet: {PLATFORM}.is_dotnet make_from_string (s: READABLE_STRING_32) -- Initialize from the characters of `s'. -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 string_exists: s /= Void ensure -- from READABLE_STRING_32 not_shared_implementation: Current /= s implies not shared_with (s) initialized: same_string (s) feature -- Access area: SPECIAL [CHARACTER_32] -- Storage for characters at alias "@" (i: INTEGER_32): CHARACTER_32 assign put -- Character at position `i' -- Was declared in STRING_32 as synonym of item. require -- from READABLE_STRING_32 True require -- from TABLE valid_key: valid_index (i) require -- from TO_SPECIAL valid_index: valid_index (i) code (i: INTEGER_32): NATURAL_32 -- Character at position `i' require -- from READABLE_STRING_GENERAL valid_index: valid_index (i) False_constant: STRING_8 = "false" -- Constant string "false" -- (from READABLE_STRING_GENERAL) 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_32) 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 generating_type: TYPE [detachable STRING_32] -- 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_32) require -- from HASHABLE True ensure -- from HASHABLE good_hash_value: Result >= 0 index_of (c: CHARACTER_32; start_index: INTEGER_32): INTEGER_32 -- Position of first occurrence of `c' at or after `start_index'; -- 0 if none. -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 start_large_enough: start_index >= 1 start_small_enough: start_index <= count + 1 ensure -- from READABLE_STRING_32 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 assign put -- Character at position `i' -- Was declared in STRING_32 as synonym of at. require -- from READABLE_INDEXABLE valid_index: valid_index (i) require -- from TABLE valid_key: valid_index (i) require -- from TO_SPECIAL valid_index: valid_index (i) item_code (i: INTEGER_32): INTEGER_32 -- Character at position `i' require -- from READABLE_STRING_32 index_small_enough: i <= count index_large_enough: i > 0 last_index_of (c: CHARACTER_32; start_index_from_end: INTEGER_32): INTEGER_32 -- Position of last occurrence of `c'. -- 0 if none -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 start_index_small_enough: start_index_from_end <= count start_index_large_enough: start_index_from_end >= 1 ensure -- from READABLE_STRING_32 last_index_of_non_negative: Result >= 0 correct_place: Result > 0 implies item (Result) = c new_cursor: INDEXABLE_ITERATION_CURSOR [CHARACTER_32] -- Fresh cursor associated with current structure -- (from READABLE_INDEXABLE) ensure -- from ITERABLE result_attached: Result /= Void shared_with (other: READABLE_STRING_32): BOOLEAN -- Does string share the text of `other'? -- (from READABLE_STRING_32) string: STRING_32 -- New STRING_32 having same character sequence as `Current'. -- (from READABLE_STRING_32) ensure -- from READABLE_STRING_32 string_not_void: Result /= Void string_type: Result.same_type (create {STRING_32}.make_empty) first_item: count > 0 implies Result.item (1) = item (1) recurse: count > 1 implies Result.substring (2, count) ~ substring (2, count).string string_representation: STRING_32 -- Similar to string but only create a new object if `Current' is not of dynamic type STRING_32 -- (from READABLE_STRING_32) ensure -- from READABLE_STRING_32 result_not_void: Result /= Void correct_type: Result.same_type (create {STRING_32}.make_empty) first_item: count > 0 implies Result.item (1) = item (1) recurse: count > 1 implies Result.substring (2, count) ~ substring (2, count).string 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_32) 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_32) 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)) True_constant: STRING_8 = "true" -- Constant string "true" -- (from READABLE_STRING_GENERAL) feature -- Measurement additional_space: INTEGER_32 -- Proposed number of additional items -- (from RESIZABLE) ensure -- from RESIZABLE at_least_one: Result >= 1 capacity: INTEGER_32 -- Allocated space -- (from READABLE_STRING_32) require -- from READABLE_STRING_GENERAL True require -- from BOUNDED True ensure -- from READABLE_STRING_GENERAL capacity_non_negative: Result >= 0 ensure -- from BOUNDED capacity_non_negative: Result >= 0 count: INTEGER_32 -- Actual number of characters making up the string -- (from READABLE_STRING_32) Growth_percentage: INTEGER_32 = 50 -- Percentage by which structure will grow automatically -- (from RESIZABLE) index_set: INTEGER_INTERVAL -- Range of acceptable indexes -- (from READABLE_STRING_32) require -- from READABLE_INDEXABLE True ensure -- from READABLE_INDEXABLE not_void: Result /= Void ensure then -- from READABLE_STRING_32 index_set_not_void: Result /= Void index_set_count: Result.count = count Minimal_increase: INTEGER_32 = 5 -- Minimal number of additional items -- (from RESIZABLE) occurrences (c: CHARACTER_32): INTEGER_32 -- Number of times `c' appears in the string -- (from READABLE_STRING_32) require -- from BAG True ensure -- from BAG non_negative_occurrences: Result >= 0 ensure then -- from READABLE_STRING_32 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 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) 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 definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.is_equal (b)) is_case_insensitive_equal (other: attached STRING_32): BOOLEAN -- Is string made of same character sequence as `other' regardless of casing -- (possibly with a different capacity)? -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 is_valid_as_string_8: is_valid_as_string_8 other_not_void: other /= Void other_is_valid_as_string_8: other.is_valid_as_string_8 ensure -- from READABLE_STRING_32 symmetric: Result implies other.is_case_insensitive_equal (Current) consistent: standard_is_equal (other) implies Result valid_result: as_lower ~ other.as_lower implies Result frozen is_deep_equal (other: attached STRING_32): 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: attached STRING_32): BOOLEAN -- Is string made of same character sequence as `other' -- (possibly with a different capacity)? -- (from READABLE_STRING_32) 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: attached STRING_32): 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 ">=" (other: attached STRING_32): 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: attached STRING_32): BOOLEAN -- Is string lexicographically lower than `other'? -- (from READABLE_STRING_32) require -- from PART_COMPARABLE other_exists: other /= Void ensure then -- from COMPARABLE asymmetric: Result implies not (other < Current) is_less_equal alias "<=" (other: attached STRING_32): 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 (other: attached STRING_32): attached STRING_32 -- 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 (other: attached STRING_32): attached STRING_32 -- 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_string (other: READABLE_STRING_32): BOOLEAN -- Do `Current' and `other' have same character sequence? -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 other_not_void: other /= Void ensure -- from READABLE_STRING_32 definition: Result = (string ~ other.string) 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 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 (other: attached STRING_32): 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) three_way_comparison (other: attached STRING_32): 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 Changeable_comparison_criterion: BOOLEAN = False -- May object_comparison be changed? -- (Answer: yes by default.) 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 ends_with (s: READABLE_STRING_32): BOOLEAN -- Does string finish with `s'? -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 argument_not_void: s /= Void ensure -- from READABLE_STRING_32 definition: Result = s.same_string (substring (count - s.count + 1, count)) ends_with_general (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)) Extendible: BOOLEAN = True -- May new items be added? (Answer: yes.) full: BOOLEAN -- Is structure full? -- (from BOUNDED) has (c: CHARACTER_32): BOOLEAN -- Does string include `c'? -- (from READABLE_STRING_32) require -- from CONTAINER True ensure -- from CONTAINER not_found_in_empty: Result implies not is_empty ensure then -- from READABLE_STRING_32 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)) 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_boolean: BOOLEAN -- Does `Current' represent a BOOLEAN? -- (from READABLE_STRING_32) require -- from READABLE_STRING_GENERAL True ensure -- from READABLE_STRING_GENERAL is_boolean: Result = (True_constant.same_string (as_lower.as_string_8) or False_constant.same_string (as_lower.as_string_8)) 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 FINITE) require -- from CONTAINER True require -- from READABLE_STRING_GENERAL True is_hashable: BOOLEAN -- May current object be hashed? -- (True by default.) -- (from HASHABLE) is_immutable: BOOLEAN -- Can the character sequence of `Current' be not changed? -- (from READABLE_STRING_GENERAL) is_inserted (v: CHARACTER_32): BOOLEAN -- 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_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 = True -- Is `Current' a sequence of CHARACTER_32? -- (from READABLE_STRING_32) Is_string_8: BOOLEAN = False -- Is `Current' a sequence of CHARACTER_8? -- (from READABLE_STRING_32) is_valid_as_string_8: BOOLEAN -- Is `Current' convertible to a sequence of CHARACTER_8 without information loss? -- (from READABLE_STRING_32) require -- from READABLE_STRING_GENERAL True object_comparison: BOOLEAN -- Must search operations use equal rather than `=' -- for comparing references? (Default: no, use `='.) -- (from CONTAINER) prunable: BOOLEAN -- May items be removed? (Answer: yes.) resizable: BOOLEAN -- May capacity be changed? (Answer: yes.) -- (from RESIZABLE) same_string_general (a_other: READABLE_STRING_GENERAL): BOOLEAN -- Does `a_other' represent the same string as `Current'? -- (from READABLE_STRING_GENERAL) require -- from READABLE_STRING_GENERAL a_other_not_void: a_other /= Void 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)) starts_with (s: READABLE_STRING_32): BOOLEAN -- Does string begin with `s'? -- (from READABLE_STRING_32) require -- from READABLE_STRING_32 argument_not_void: s /= Void ensure -- from READABLE_STRING_32 definition: Result = s.same_string (substring (1, s.count)) starts_with_general (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)) valid_code (v: NATURAL_32): BOOLEAN -- Is `v' a valid code for a CHARACTER_32? -- (from READABLE_STRING_32) require -- from READABLE_STRING_GENERAL True valid_index (i: INTEGER_32): BOOLEAN -- Is `i' within the bounds of the string? -- (from READABLE_STRING_GENERAL) require -- from READABLE_INDEXABLE True require -- from TABLE True require -- from TO_SPECIAL True ensure -- from READABLE_INDEXABLE only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper)) ensure -- from READABLE_STRING_GENERAL definition: Result = (1 <= i and i <= count) feature -- Status setting compare_objects -- Ensure that future search operations will use equal -- rather than `=' for comparing references. -- (from CONTAINER) require -- from CONTAINER changeable_comparison_criterion: Changeable_comparison_criterion ensure -- from CONTAINER object_comparison compare_references -- Ensure that future search operations will use `=' -- rather than equal for comparing references. -- (from CONTAINER) require -- from CONTAINER changeable_comparison_criterion: Changeable_comparison_criterion ensure -- from CONTAINER reference_comparison: not object_comparison feature -- Element change append (s: READABLE_STRING_32) -- Append a copy of `s' at end. require argument_not_void: s /= Void ensure new_count: count = old count + old s.count appended: Elks_checking implies Current ~ (old twin + old s.twin) append_boolean (b: BOOLEAN) -- Append the string representation of `b' at end. append_character (c: CHARACTER_32) -- Append `c' at end. -- Was declared in STRING_32 as synonym of extend. ensure then item_inserted: item (count) = c new_count: count = old count + 1 stable_before: Elks_checking implies substring (1, count - 1) ~ (old twin) append_code (c: like code) -- Append `c' at end. -- (from STRING_GENERAL) require -- from STRING_GENERAL valid_code: valid_code (c) ensure then -- from STRING_GENERAL item_inserted: code (count) = c new_count: count = old count + 1 stable_before: Elks_checking implies substring (1, count - 1) ~ (old twin) append_double (d: REAL_64) -- Append the string representation of `d' at end. append_integer (i: INTEGER_32) -- Append the string representation of `i' at end. append_integer_16 (i: INTEGER_16) -- Append the string representation of `i' at end. append_integer_64 (i: INTEGER_64) -- Append the string representation of `i' at end. append_integer_8 (i: INTEGER_8) -- Append the string representation of `i' at end. append_natural_16 (i: NATURAL_16) -- Append the string representation of `i' at end. append_natural_32 (i: NATURAL_32) -- Append the string representation of `i' at end. append_natural_64 (i: NATURAL_64) -- Append the string representation of `i' at end. append_natural_8 (i: NATURAL_8) -- Append the string representation of `i' at end. append_real (r: REAL_32) -- Append the string representation of `r' at end. append_string (s: detachable READABLE_STRING_32) -- Append a copy of `s', if not void, at end. ensure appended: s /= Void implies (Elks_checking implies Current ~ (old twin + old s.twin)) append_string_general (s: READABLE_STRING_GENERAL) -- Append a copy of `s' at end. require -- from STRING_GENERAL argument_not_void: s /= Void compatible_strings: Is_string_8 implies s.is_valid_as_string_8 ensure -- from STRING_GENERAL new_count: count = old count + old s.count appended: Elks_checking implies to_string_32 ~ (old to_string_32.twin + old s.to_string_32.twin) extend (c: CHARACTER_32) -- Append `c' at end. -- Was declared in STRING_32 as synonym of append_character. require -- from COLLECTION extendible: Extendible ensure -- from COLLECTION item_inserted: is_inserted (c) ensure then item_inserted: item (count) = c new_count: count = old count + 1 stable_before: Elks_checking implies substring (1, count - 1) ~ (old twin) fill (other: CONTAINER [CHARACTER_32]) -- Fill with as many items of `other' as possible. -- The representations of `other' and current structure -- need not be the same. -- (from COLLECTION) require -- from COLLECTION other_not_void: other /= Void extendible: Extendible fill_blank -- Fill with capacity blank characters. ensure filled: full same_size: (count = capacity) and (capacity = old capacity) fill_character (c: CHARACTER_32) -- Fill with capacity characters all equal to `c'. -- (from READABLE_STRING_32) ensure -- from READABLE_STRING_32 filled: count = capacity same_size: capacity = old capacity fill_with (c: CHARACTER_32) -- Replace every character with `c'. ensure same_count: (count = old count) and (capacity = old capacity) filled: Elks_checking implies occurrences (c) = count insert_character (c: CHARACTER_32; i: INTEGER_32) -- Insert `c' at index `i', shifting characters between ranks -- `i' and count rightwards. require valid_insertion_index: 1 <= i and i <= count + 1 ensure one_more_character: count = old count + 1 inserted: item (i) = c stable_before_i: Elks_checking implies substring (1, i - 1) ~ (old substring (1, i - 1)) stable_after_i: Elks_checking implies substring (i + 1, count) ~ (old substring (i, count)) insert_string (s: READABLE_STRING_32; i: INTEGER_32) -- Insert `s' at index `i', shifting characters between ranks -- `i' and count rightwards. require string_exists: s /= Void valid_insertion_index: 1 <= i and i <= count + 1 ensure inserted: Elks_checking implies (Current ~ (old substring (1, i - 1) + old (s.twin) + old substring (i, count))) keep_head (n: INTEGER_32) -- Remove all characters except for the first `n'; -- do nothing if `n' >= count. require -- from STRING_GENERAL non_negative_argument: n >= 0 ensure -- from STRING_GENERAL new_count: count = n.min (old count) kept: Elks_checking implies Current ~ (old substring (1, n.min (count))) keep_tail (n: INTEGER_32) -- Remove all characters except for the last `n'; -- do nothing if `n' >= count. require -- from STRING_GENERAL non_negative_argument: n >= 0 ensure -- from STRING_GENERAL new_count: count = n.min (old count) kept: Elks_checking implies Current ~ (old substring (count - n.min (count) + 1, count)) left_adjust -- Remove leading whitespace. ensure valid_count: count <= old count new_count: not is_empty implies not item (1).is_space kept: Elks_checking implies Current ~ ((old twin).substring (old count - count + 1, old count)) plus alias "+" (s: READABLE_STRING_32): like Current -- Append a copy of 's' at the end of a copy of Current, -- Then return the Result. require -- from READABLE_STRING_32 argument_not_void: s /= Void ensure -- from READABLE_STRING_32 result_exists: Result /= Void new_count: Result.count = count + s.count initial: Elks_checking implies Result.substring (1, count) ~ Current final: Elks_checking implies Result.substring (count + 1, count + s.count).same_string (s) plus_string_general (s: READABLE_STRING_GENERAL): like Current require -- from READABLE_STRING_GENERAL argument_not_void: s /= Void compatible_strings: Is_string_8 implies s.is_valid_as_string_8 ensure -- from READABLE_STRING_GENERAL plus_not_void: Result /= Void new_count: Result.count = count + s.count initial: Elks_checking implies Result.substring (1, count) ~ Current final: Elks_checking implies Result.substring (count + 1, count + s.count).same_string_general (s) precede (c: CHARACTER_32) -- Add `c' at front. -- Was declared in STRING_32 as synonym of prepend_character. ensure new_count: count = old count + 1 prepend (s: READABLE_STRING_32) -- Prepend a copy of `s' at front. require argument_not_void: s /= Void ensure new_count: count = old (count + s.count) inserted: Elks_checking implies string ~ (old (s.twin.as_string_32) + old substring (1, count)) prepend_boolean (b: BOOLEAN) -- Prepend the string representation of `b' at front. prepend_character (c: CHARACTER_32) -- Add `c' at front. -- Was declared in STRING_32 as synonym of precede. ensure new_count: count = old count + 1 prepend_double (d: REAL_64) -- Prepend the string representation of `d' at front. prepend_integer (i: INTEGER_32) -- Prepend the string representation of `i' at front. prepend_real (r: REAL_32) -- Prepend the string representation of `r' at front. prepend_string (s: detachable READABLE_STRING_32) -- Prepend a copy of `s', if not void, at front. prepend_string_general (s: READABLE_STRING_GENERAL) -- Add `s' at front. require -- from STRING_GENERAL argument_not_void: s /= Void compatible_strings: Is_string_8 implies s.is_valid_as_string_8 ensure -- from STRING_GENERAL new_count: count = old (count + s.count) inserted: Elks_checking implies to_string_32 ~ (old s.to_string_32.twin + old to_string_32.twin) put (c: CHARACTER_32; i: INTEGER_32) -- Replace character at position `i' by `c'. require -- from TABLE valid_key: valid_index (i) require -- from TABLE valid_key: valid_index (i) require -- from TO_SPECIAL valid_index: valid_index (i) ensure -- from TABLE inserted: item (i) = c ensure -- from TO_SPECIAL inserted: item (i) = c ensure then stable_count: count = old count stable_before_i: Elks_checking implies substring (1, i - 1) ~ (old substring (1, i - 1)) stable_after_i: Elks_checking implies substring (i + 1, count) ~ (old substring (i + 1, count)) put_code (v: NATURAL_32; i: INTEGER_32) -- Replace character at position `i' by character of code `v'. require -- from STRING_GENERAL valid_code: valid_code (v) valid_index: valid_index (i) ensure -- from STRING_GENERAL inserted: code (i) = v stable_count: count = old count stable_before_i: Elks_checking implies substring (1, i - 1) ~ (old substring (1, i - 1)) stable_after_i: Elks_checking implies substring (i + 1, count) ~ (old substring (i + 1, count)) replace_blank -- Replace all current characters with blanks. ensure same_size: (count = old count) and (capacity = old capacity) all_blank: Elks_checking implies occurrences (' '.to_character_32) = count replace_substring (s: READABLE_STRING_32; start_index, end_index: INTEGER_32) -- Replace characters from `start_index' to `end_index' with `s'. require string_not_void: s /= Void valid_start_index: 1 <= start_index valid_end_index: end_index <= count meaningfull_interval: start_index <= end_index + 1 ensure new_count: count = old count + old s.count - end_index + start_index - 1 replaced: Elks_checking implies (Current ~ (old (substring (1, start_index - 1) + s + substring (end_index + 1, count)))) replace_substring_all (original, new: READABLE_STRING_32) -- Replace every occurrence of `original' with `new'. require original_exists: original /= Void new_exists: new /= Void original_not_empty: not original.is_empty right_adjust -- Remove trailing whitespace. ensure valid_count: count <= old count new_count: (count /= 0) implies ((item (count) /= ' '.to_character_32) and (item (count) /= '%T'.to_character_32) and (item (count) /= '%R'.to_character_32) and (item (count) /= '%N'.to_character_32)) kept: Elks_checking implies Current ~ ((old twin).substring (1, count)) set (t: READABLE_STRING_32; n1, n2: INTEGER_32) -- Set current string to substring of `t' from indices `n1' -- to `n2', or to empty string if no such substring. require argument_not_void: t /= Void ensure is_substring: Current ~ (t.substring (n1, n2)) share (other: STRING_32) -- Make current string share the text of `other'. -- Subsequent changes to the characters of current string -- will also affect `other', and conversely. require argument_not_void: other /= Void ensure shared_count: other.count = count shared_area: other.area = area subcopy (other: READABLE_STRING_32; start_pos, end_pos, index_pos: INTEGER_32) -- Copy characters of `other' within bounds `start_pos' and -- `end_pos' to current string starting at index `index_pos'. require 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) enough_space: (count - index_pos) >= (end_pos - start_pos) ensure same_count: count = old count copied: Elks_checking implies (Current ~ (old substring (1, index_pos - 1) + old other.substring (start_pos, end_pos) + old substring (index_pos + (end_pos - start_pos + 1), count))) feature -- Removal prune (c: CHARACTER_32) -- Remove first occurrence of `c', if any. require -- from COLLECTION prunable: prunable require else True prune_all (c: CHARACTER_32) -- Remove all occurrences of `c'. require -- from COLLECTION prunable: prunable require else True ensure -- from COLLECTION no_more_occurrences: not has (c) ensure then changed_count: count = (old count) - (old occurrences (c)) prune_all_leading (c: CHARACTER_32) -- Remove all leading occurrences of `c'. prune_all_trailing (c: CHARACTER_32) -- Remove all trailing occurrences of `c'. remove (i: INTEGER_32) -- Remove `i'-th character. require -- from STRING_GENERAL valid_index: valid_index (i) ensure -- from STRING_GENERAL new_count: count = old count - 1 removed: Elks_checking implies to_string_32 ~ (old substring (1, i - 1).to_string_32 + old substring (i + 1, count).to_string_32) remove_head (n: INTEGER_32) -- Remove first `n' characters; -- if `n' > count, remove all. require n_non_negative: n >= 0 ensure removed: Elks_checking implies Current ~ (old substring (n.min (count) + 1, count)) remove_substring (start_index, end_index: INTEGER_32) -- Remove all characters from `start_index' -- to `end_index' inclusive. require valid_start_index: 1 <= start_index valid_end_index: end_index <= count meaningful_interval: start_index <= end_index + 1 ensure removed: Elks_checking implies Current ~ (old substring (1, start_index - 1) + old substring (end_index + 1, count)) remove_tail (n: INTEGER_32) -- Remove last `n' characters; -- if `n' > count, remove all. require n_non_negative: n >= 0 ensure removed: Elks_checking implies Current ~ (old substring (1, count - n.min (count))) wipe_out -- Remove all characters. require -- from COLLECTION prunable: prunable ensure -- from COLLECTION wiped_out: is_empty ensure then is_empty: count = 0 same_capacity: capacity = old capacity feature -- Resizing adapt_size -- Adapt the size to accommodate count characters. automatic_grow -- Change the capacity to accommodate at least -- Growth_percentage more items. -- (from RESIZABLE) require -- from RESIZABLE resizable: resizable ensure -- from RESIZABLE increased_capacity: capacity >= old capacity + old additional_space grow (newsize: INTEGER_32) -- Ensure that the capacity is at least `newsize'. require -- from RESIZABLE resizable: resizable ensure -- from RESIZABLE new_capacity: capacity >= newsize resize (newsize: INTEGER_32) -- Rearrange string so that it can accommodate -- at least `newsize' characters. -- Do not lose any previously entered character. require -- from STRING_GENERAL new_size_large_enough: newsize >= count ensure -- from STRING_GENERAL same_count: count = old count capacity_large_enough: capacity >= newsize same_content: Elks_checking implies same_string_general (old twin) trim -- Decrease capacity to the minimum value. -- Apply to reduce allocated storage. require -- from RESIZABLE True ensure -- from RESIZABLE same_count: count = old count minimal_capacity: capacity = count ensure then same_string: same_string (old twin) feature -- Transformation correct_mismatch -- Attempt to correct object mismatch during retrieve using Mismatch_information. feature -- Conversion as_lower: like Current -- New object with all letters in lower case. require -- from READABLE_STRING_GENERAL is_valid_as_string_8: is_valid_as_string_8 ensure -- from READABLE_STRING_GENERAL as_lower_attached: Result /= Void length: Result.count = count anchor: count > 0 implies Result.code (1).to_character_8 = code (1).to_character_8.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) and Result = Current) or (not conforms_to (create {STRING_32}.make_empty) and Result /= Current) as_string_8: STRING_8 -- Convert `Current' as a STRING_8. If a code of `Current' is -- not a valid code for a STRING_8 it is replaced with the null -- character. -- (from READABLE_STRING_GENERAL) 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) as_upper: like Current -- New object with all letters in upper case require -- from READABLE_STRING_GENERAL is_valid_as_string_8: is_valid_as_string_8 ensure -- from READABLE_STRING_GENERAL as_upper_attached: Result /= Void length: Result.count = count anchor: count > 0 implies Result.code (1).to_character_8 = code (1).to_character_8.as_upper recurse: count > 1 implies Result.substring (2, count) ~ substring (2, count).as_upper center_justify -- Center justify Current using count as width. require is_valid_as_string_8: is_valid_as_string_8 character_justify (pivot: CHARACTER_32; position: INTEGER_32) -- 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. require valid_position: position <= capacity positive_position: position >= 1 pivot_not_space: pivot /= ' '.to_character_32 not_empty: not is_empty left_justify -- Left justify Current using count as witdth. linear_representation: LINEAR [CHARACTER_32] -- Representation as a linear structure mirror -- Reverse the order of characters. -- "Hello world" -> "dlrow olleH". ensure same_count: count = old count mirrored: like Current -- Mirror image of string; -- Result for "Hello world" is "dlrow olleH". ensure -- from READABLE_STRING_32 same_count: Result.count = count right_justify -- Right justify Current using count as width. ensure same_count: count = old count split (a_separator: CHARACTER_32): LIST [attached STRING_32] -- Split on `a_separator'. -- (from READABLE_STRING_32) ensure -- from READABLE_STRING_32 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_general (True_constant)) or (not Result = as_lower.same_string_general (False_constant)) frozen to_c: ANY -- A reference to a C form of current string. -- Useful only for interfacing with C software. require not_is_dotnet: not {PLATFORM}.is_dotnet 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_lower -- Convert to lower case. require is_valid_as_string_8: is_valid_as_string_8 ensure length_and_content: Elks_checking implies Current ~ (old as_lower) 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) and Result = Current) or (not conforms_to (create {STRING_32}.make_empty) 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) to_upper -- Convert to upper case. require is_valid_as_string_8: is_valid_as_string_8 ensure length_and_content: Elks_checking implies Current ~ (old as_upper) feature -- Duplication copy (other: attached STRING_32) -- Reinitialize by copying the characters of `other'. -- (This is also used by twin.) -- (from READABLE_STRING_32) require -- from ANY other_not_void: other /= Void type_identity: same_type (other) ensure -- from ANY is_equal: Current ~ other ensure then -- from READABLE_STRING_32 new_result_count: count = other.count frozen deep_copy (other: attached STRING_32) -- 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: attached STRING_32 -- New object structure recursively duplicated from Current. -- (from ANY) ensure -- from ANY deep_twin_not_void: Result /= Void deep_equal: deep_equal (Current, Result) multiply (n: INTEGER_32) -- Duplicate a string within itself -- ("hello").multiply(3) => "hellohellohello" require meaningful_multiplier: n >= 1 frozen standard_copy (other: attached STRING_32) -- 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: attached STRING_32 -- 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): like Current -- Copy of substring containing all characters at indices -- between `start_index' and `end_index' require -- from READABLE_STRING_GENERAL True 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.code (1) = code (start_index) recurse: Result.count > 0 implies Result.substring (2, Result.count) ~ substring (start_index + 1, end_index) frozen twin: attached STRING_32 -- New object equal to `Current' -- twin calls copy; to change copying/twining semantics, redefine copy. -- (from ANY) ensure -- from ANY twin_not_void: Result /= Void is_equal: Result ~ Current feature -- Basic operations frozen as_attached: attached STRING_32 -- Attached version of Current -- (Can be used during transitional period to convert -- non-void-safe classes to void-safe ones.) -- (from ANY) frozen default: detachable STRING_32 -- 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) default_rescue -- Process exception for routines with no Rescue clause. -- (Default: do nothing.) -- (from ANY) frozen do_nothing -- Execute a null action. -- (from ANY) feature -- Correction Mismatch_information: MISMATCH_INFORMATION -- Original attribute values of mismatched object -- (from MISMATCH_CORRECTOR) feature -- Output Io: STD_FILES -- Handle to standard file setup -- (from ANY) ensure -- from ANY io_not_void: Result /= Void out: STRING_8 -- Printable representation -- (from READABLE_STRING_32) require -- from ANY True ensure -- from ANY out_not_void: Result /= Void ensure then -- from READABLE_STRING_32 out_not_void: Result /= Void same_items: same_type ("") implies same_string (Result.as_string_32) print (o: detachable ANY) -- Write terse external representation of `o' -- on standard output. -- (from ANY) 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 operating_environment_not_void: Result /= Void invariant extendible: Extendible compare_character: not object_comparison -- from READABLE_STRING_32 area_not_void: area /= Void -- from COMPARABLE irreflexive_comparison: not (Current < Current) -- from ANY reflexive_equality: standard_is_equal (Current) reflexive_conformance: conforms_to (Current) -- from STRING_GENERAL mutable: not is_immutable -- from RESIZABLE increase_by_at_least_one: Minimal_increase >= 1 -- from BOUNDED valid_count: count <= capacity full_definition: full = (count = capacity) -- from FINITE empty_definition: is_empty = (count = 0) note copyright: "Copyright (c) 1984-2012, 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 STRING_32
Classes Clusters Cluster hierarchy Chart Relations Flat contracts Go to:

-- Generated by Eiffel Studio --
For more details: docs.eiffel.com