INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

copyright: "Object Tools, 1996-2001"
version: "1.2"
cluster: formats
class G_SCIENTIFIC_FORMAT
inherit

ANY
rename
print as any_print
end
creation

make
feature

default_escape: CHARACTER

Asterisk: CHARACTER

Dot: CHARACTER

frozen Format_flags: STRING

Minus: CHARACTER

Plus: CHARACTER

Zero: CHARACTER

Space: CHARACTER

Center: CHARACTER

make

set_escape (ch: CHARACTER)
feature -- Print group of argruments using specified format

printf (format: STRING; para: ARRAY [ANY])
-- formats list of items and prints them
require
non_void_format: format /= void

sprintf (format: STRING; para: ARRAY [ANY]): STRING
-- formats list of items into string
-- errors checked only in precondition
require
non_void_format: format /= void
ensure
Result /= void

to_string (format: STRING; para: ANY): STRING
-- format single argument to string
require
non_void_paramenters: format /= void and para /= void
ensure
Result /= void
feature -- Print single element using default format

print (para: ANY)
-- print argument using default format string
require
non_void_paramenter: para /= void

sprint (para: ANY): STRING
-- print argument to string using default format string
require
non_void_paramenter: para /= void
ensure
Result /= void

set_default_format (format: STRING)
-- Get typechar from format string.
-- Set this format for all types that conforms
-- to determined by typechar.
-- e.g. After call set_default_format("012x")
-- result of print(i) will be the same as printf("!012x", i)
--
-- default escape is optional in format string("!12x" same as "12x")
--
require
valid_format: format /= void and then format.count > 0 and then (format @ 1 = default_escape implies format.count > 1)

default_format (sample: ANY): STRING
require
sample /= void
feature -- secret

args: G_ARGUMENTS_ITERATOR
end -- class G_SCIENTIFIC_FORMAT

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES