elogger API
Overview Classes Cluster Class Index          Top Features

string.formatter.general

Class ST_FORMATTING_ROUTINES


Direct ancestors

ST_SHARED_FORMATTERS, KL_IMPORTED_ANY_ROUTINES

Features

Invariants

indexing

description

String formatting routines

library

Gobo Eiffel String Library

copyright

Copyright (c) 2004, Berend de Boer and others

license

Eiffel Forum License v2 (see forum.txt)

class ST_FORMATTING_ROUTINES

feature -- Access

format (a_format: STRING; a_parameters: ARRAY[ANY]): STRING

-- Copy of a_format where the formatting specifications
-- have been replaced by their corresponding formatted
-- parameters from a_parameters
--
-- (a_parameters must be an array of references and should
-- not contain expanded types. SE will core dump if you try
-- to do that. Furthermore, in SE 2.1 expanded types such as
-- INTEGER_32 do not conform to ANY anymore. So, instead of
-- expanded parameters such as INTEGER_32 we should pass a
-- 'DS_CELL [INTEGER_32]'.)

require

a_format_not_void: a_format /= Void
valid_format_and_parameters: valid_format_and_parameters (a_format, a_parameters)

ensure

formatted_string_not_void: Result /= Void
same_type: ANY_.same_types (a_format, Result)

format_single (a_format: STRING; a_parameter: ANY): STRING

-- Copy of a_format where the single formatting specification
-- have been replaced by formatted version of a_parameter
--
-- (In SE 2.1 expanded types such as INTEGER_32 do not conform
-- to ANY anymore. So, instead of expanded parameters such
-- as INTEGER_32 we should pass a 'DS_CELL [INTEGER_32]'.)

require

a_format_not_void: a_format /= Void
valid_format_and_parameters: valid_format_and_parameters (a_format, <<a_parameter>>)

ensure

formatted_string_not_void: Result /= Void
same_type: ANY_.same_types (a_format, Result)

feature -- Status report

valid_format_and_parameters (a_format: STRING; a_parameters: ARRAY[ANY]): BOOLEAN

-- Does a_format contain valid formatting specifications and
-- do a_parameters comply to these formatting specifications?

require

a_format_not_void: a_format /= Void

feature -- Convenience

boolean_cell (a_boolean: BOOLEAN): DS_CELL[BOOLEAN]

-- New 'DS_CELL [BOOLEAN]' for use in input array
-- (Necessary because SE does not support BOOLEAN_REF
-- or 'reference BOOLEAN' anymore.)

ensure

cell_not_void: Result /= Void
item_set: Result.item = a_boolean

character_cell (a_char: CHARACTER): DS_CELL[CHARACTER]

-- New 'DS_CELL [CHARACTER_8]' for use in input array
-- (Necessary because SE does not support CHARACTER_8_REF
-- or 'reference CHARACTER_8' anymore.)

ensure

cell_not_void: Result /= Void
item_set: Result.item = a_char

double_cell (a_double: DOUBLE): DS_CELL[DOUBLE]

-- New 'DS_CELL [REAL_64]' for use in input array
-- (Necessary because SE does not support REAL_64_REF
-- or 'reference REAL_64' anymore.)

ensure

cell_not_void: Result /= Void
item_set: Result.item = a_double

integer_cell (an_integer: INTEGER): DS_CELL[INTEGER]

-- New 'DS_CELL [INTEGER_32]' for use in input array
-- (Necessary because SE does not support INTEGER_32_REF
-- or 'reference INTEGER_32' anymore.)

ensure

cell_not_void: Result /= Void
item_set: Result.item = an_integer

invariant

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

Documentation generated by edoc