indexing
description: "A low-level string class to solve some garbage collector problems (object move). The end-user must not use this class. Use class STRING instead."
status: "See notice at end of class."
date: "$Date$"
revision: "$Revision$"
class interface
WEL_STRING
create
make (a_string: STRING)
a_string
require
a_string_not_void: a_string /= void
ensure
not_shared: not shared
make_empty (a_length: INTEGER)
a_length
require
positive_length: a_length >= 0
make_by_pointer (a_pointer: POINTER)
itema_pointer
item
a_pointer
WEL_ANY
ensure WEL_ANY
item_set: item = a_pointer
shared: shared
feature
count: INTEGER
WEL_STRINGlength
item: POINTER
WEL_ANY
length: INTEGER
WEL_STRINGcount
null_separated_strings: LINKED_LIST [STRING]
item
item
ensure
result_not_void: Result /= void
space_separated_strings: LINKED_LIST [STRING]
item
item
ensure
result_not_void: Result /= void
string: STRING
ensure
result_not_void: Result /= void
feature
capacity: INTEGER
set_string
structure_size: INTEGER
ensure WEL_STRUCTURE
positive_result: Result > 0
feature
exists: BOOLEAN
item
WEL_ANY
ensure WEL_ANY
Result = (item /= default_pointer)
shared: BOOLEAN
item
item
destroy_item
item
WEL_ANY
feature
set_shared
shared
WEL_ANY
ensure WEL_ANY
shared: shared
set_unshared
shared
WEL_ANY
ensure WEL_ANY
unshared: not shared
feature
set_item (an_item: POINTER)
iteman_item
WEL_ANY
ensure WEL_ANY
item_set: item = an_item
set_null_character (offset: INTEGER)
%UoffsetCurrent
0
require
valid_offset: offset >= 0 and offset < capacity
set_size_in_string (n: INTEGER)
item
n
require
valid_size: n > 0
set_string (a_string: STRING)
stringa_string
require
a_string_not_void: a_string /= void
valid_count: a_string.count < capacity
ensure
string_set: a_string.is_equal (string)
feature
dispose
Current
Current
WEL_ANY
feature
to_integer: INTEGER
item
WEL_ANY
ensure WEL_ANY
Result = cwel_pointer_to_integer (item)
feature
initialize
WEL_STRUCTURE
require WEL_STRUCTURE
exists: exists
initialize_with_character (a_character: CHARACTER)
a_character
WEL_STRUCTURE
require WEL_STRUCTURE
exists: exists
memory_copy (source_pointer: POINTER; length: INTEGER)
lengthsource_pointeritem
WEL_STRUCTURE
require WEL_STRUCTURE
length_small_enough: length <= structure_size
length_large_enough: length > 0
exists: exists
invariant
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
end -- WEL_STRING