Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

xml.general

Class XM_STRING_MODE


Direct ancestors

KL_IMPORTED_BOOLEAN_ROUTINES

Known direct descendants

XM_PARSER, XM_CATALOG, XM_XSLT_CONFIGURATION, XM_XPATH_EVALUATOR, XM_XPATH_STAND_ALONE_DYNAMIC_CONTEXT

Features

Invariants

indexing

description

String creation policy for a source of unicode strings

library

Gobo Eiffel XML Library

copyright

Copyright (c) 2001, Andreas Leitner and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2004/07/13 11:48:02 $

revision

$Revision: 1.10 $

class

XM_STRING_MODE

feature -- Status report

is_string_mode_ascii: BOOLEAN

-- Is string mode set to ascii only?
-- This means that all strings issued by this source
-- will be of dynamic type STRING.

is_string_mode_latin1: BOOLEAN

-- Is string mode set to latin-1 only?
-- This means that all strings issued by this source
-- will be of dynamic type STRING.

is_string_mode_mixed: BOOLEAN

-- Is string mode set to polymorphic strings?
-- This means that strings issued by this source will
-- be of dynamic type STRING for ascii, and dynamic
-- type UC_STRING or descendant when characters >127
-- are present in that string.

is_string_mode_unicode: BOOLEAN

-- Is string mode set to UC_STRING only?
-- This means that all strings issued by this source
-- will be of a dynamic type UC_STRING or descendant.

same_string_mode (other: XM_STRING_MODE): BOOLEAN

-- Is other with the same string mode?

require
other_not_void: other /= Void

feature -- Status setting

set_string_mode_ascii

-- Set all strings issued by this source to be ascii
-- (all characters <= 127) and be of dynamic type STRING.
-- The source will be in an error state if it has
-- characters that do not fit in a STRING.

ensure
string_mode_set: is_string_mode_ascii
set_string_mode_latin1

-- Set all strings issued by this source to be latin-1
-- (all characters <= 255) and be of dynamic type STRING.
-- The source will be in an error state if it has
-- characters that do not fit in a STRING.

ensure
string_mode_set: is_string_mode_latin1
set_string_mode_mixed

-- Set all strings issued by this source to be either of
-- type UC_STRING or descendant if they contain characters
-- >127 or of dynamic type STRING otherwise.
-- The client receiving these strings will have to
-- be careful about polymorphically unsafe features
-- of STRING, like append_string.

ensure
string_mode_set: is_string_mode_mixed
set_string_mode_unicode

-- Set all strings issued by this source to be of
-- dynamic type UC_STRING or descendant.

ensure
string_mode_set: is_string_mode_unicode

feature -- Copy

copy_string_mode (other: XM_STRING_MODE)

-- Copy string mode.

require
other_not_void: other /= Void
ensure
copied: same_string_mode (other)

feature {XM_STRING_MODE} -- Implementation

string_mode: INTEGER

-- STRING/UC_STRING mode

invariant

mode_set: BOOLEAN_.nxor (<<is_string_mode_ascii, is_string_mode_mixed, is_string_mode_unicode, is_string_mode_latin1>>)

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

end