elogger API
Overview Classes Cluster Class Index          Top Features

string.formatter.parameter

Class ST_UNSIGNED_HEXADECIMAL_FORMATTER


Direct ancestors

ST_UNSIGNED_INTEGER_FORMATTER

Creation

Features

Invariants

indexing

description

Formatters for unsigned integer parameters, $x or $X

library

Gobo Eiffel String Library

copyright

Copyright (c) 2004-2005, Object-Tools and others

license

Eiffel Forum License v2 (see forum.txt)

class ST_UNSIGNED_HEXADECIMAL_FORMATTER

inherit

ST_UNSIGNED_INTEGER_FORMATTER
ST_INTEGER_FORMATTER

create

make

-- Create a new formatter.
-- (From ST_PARAMETER_FORMATTER)

feature -- Initialization

reset_options

-- Reset options to their default values.
-- (From ST_PARAMETER_FORMATTER)

feature -- Access

base: INTEGER

-- Base used to format integer;
-- 8 for octal, 10 for decimal, 16 for hexadecimal, ...
-- (From ST_INTEGER_FORMATTER)

ensure

base_large_enough: Result >= 2
base_small_enough: Result <= 36

feature -- Status report

valid_parameter (a_parameter: ANY): BOOLEAN

-- Is a_parameter a valid parameter for current formatter?
-- (From ST_PARAMETER_FORMATTER)

require

a_parameter_not_void: a_parameter /= Void

feature -- Formatting

integer_format_to (a_parameter: INTEGER; a_stream: KI_CHARACTER_OUTPUT_STREAM)

-- Format a_parameter to a_stream.
-- (From ST_INTEGER_FORMATTER)

require

a_stream_not_void: a_stream /= Void
a_stream_open_write: a_stream.is_open_write

format_to (a_parameter: ANY; a_stream: KI_CHARACTER_OUTPUT_STREAM)

-- Format a_parameter to a_stream.
-- (Use DS_CELL [INTEGER_32] because in SE 2.1
-- INTEGER_32 does not conform to ANY.)
-- (From ST_PARAMETER_FORMATTER)

require

a_parameter_not_void: a_parameter /= Void
valid_parameter: valid_parameter (a_parameter)
a_stream_not_void: a_stream /= Void
a_stream_open_write: a_stream.is_open_write

feature -- Options

is_center_aligned: BOOLEAN

-- Should formatted parameter be centered?
-- (From ST_PARAMETER_FORMATTER)

is_left_aligned: BOOLEAN

-- Should formatted parameter be aligned to the left?
-- (From ST_PARAMETER_FORMATTER)

is_lowercase: BOOLEAN

-- Should the formatted parameter be in lowercase?
-- (Not applicable to all formatters.)
-- (From ST_PARAMETER_FORMATTER)

is_right_aligned: BOOLEAN

-- Should formatted parameter be aligned to the right?
-- (From ST_PARAMETER_FORMATTER)

padding_character: CHARACTER

-- Padding character
-- (Default is space character)
-- (From ST_PARAMETER_FORMATTER)

plus_sign_enabled: BOOLEAN

-- Should the '+' sign be shown in the formatted parameter?
-- (By default only the '-' sign is shown.)
-- (From ST_PARAMETER_FORMATTER)

precision: INTEGER

-- Precision (formatter-dependent meaning)
-- (May cause truncation of formatted parameter.)
-- (From ST_PARAMETER_FORMATTER)

width: INTEGER

-- Minimum width of formatted parameter
-- (Does never cause truncation of formatted parameter.)
-- (From ST_PARAMETER_FORMATTER)

feature -- Setting

set_align_center

-- Set center alignment.
-- (From ST_PARAMETER_FORMATTER)

ensure

is_center_aligned: is_center_aligned

set_align_left

-- Set left alignment.
-- (From ST_PARAMETER_FORMATTER)

ensure

is_left_aligned: is_left_aligned

set_align_right

-- Set right alignment.
-- (From ST_PARAMETER_FORMATTER)

ensure

is_right_aligned: is_right_aligned

set_lowercase (b: BOOLEAN)

-- Set is_lowercase to b.
-- (From ST_PARAMETER_FORMATTER)

ensure

is_lowercase_set: is_lowercase = b

set_padding_character (c: CHARACTER)

-- Set padding_character to c.
-- (From ST_PARAMETER_FORMATTER)

ensure

padding_character_set: padding_character = c

set_plus_sign_enabled (b: BOOLEAN)

-- Set plus_sign_enabled to b.
-- (From ST_PARAMETER_FORMATTER)

ensure

plus_sign_enabled_set: plus_sign_enabled = b

set_precision (p: INTEGER)

-- Set precision to p.
-- (From ST_PARAMETER_FORMATTER)

require

p_not_negative: p >= 0

ensure

precision_set: precision = p

set_width (w: INTEGER)

-- Set width to w.
-- (From ST_PARAMETER_FORMATTER)

require

w_not_negative: w >= 0

ensure

width_set: width = w

invariant


-- From ST_INTEGER_FORMATTER
integer_buffer_not_void: integer_buffer /= Void

-- From ST_PARAMETER_FORMATTER
valid_alignment: alignment = align_left or alignment = align_right or alignment = align_center
precision_not_negative: precision >= 0
width_not_negative: width >= 0

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

Documentation generated by edoc