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

xml.parser.eiffel

Class XM_EIFFEL_CHARACTER_ENTITY


Direct ancestors

KL_IMPORTED_INTEGER_ROUTINES, KL_IMPORTED_STRING_ROUTINES, KL_IMPORTED_ANY_ROUTINES, KL_SHARED_PLATFORM, UC_IMPORTED_UTF8_ROUTINES, UC_IMPORTED_UNICODE_ROUTINES

Creation

Features

Invariants

indexing

description

Handler for character references/entities

library

Gobo Eiffel XML Library

copyright

Copyright (c) 2002, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/07/13 19:48:54 $

revision

$Revision: 1.7 $

class

XM_EIFFEL_CHARACTER_ENTITY

inherit

KL_IMPORTED_INTEGER_ROUTINES
KL_IMPORTED_STRING_ROUTINES
KL_IMPORTED_ANY_ROUTINES
KL_SHARED_PLATFORM
UC_IMPORTED_UTF8_ROUTINES
UC_IMPORTED_UNICODE_ROUTINES

create

make

-- Create a new character entity.

feature -- Initialization

from_code (a_code: INTEGER)

-- Set entity from integer code.

require
a_code_positive: a_code >= 0
ensure
code_set: code = a_code
from_decimal (a_string: STRING)

-- Set entity from decimal representation.

require
a_string_not_void: a_string /= Void
a_string_is_decimal: STRING_.is_integer (a_string)
from_hexadecimal (a_string: STRING)

-- Set entity from hexadecimal representation.

require
a_string_not_void: a_string /= Void
a_string_is_hexadecimal: STRING_.is_hexadecimal (a_string)

feature -- Access

any_: KL_ANY_ROUTINES

-- Routines that ought to be in class ANY

-- (From KL_IMPORTED_ANY_ROUTINES)

ensure
any_routines_not_void: Result /= Void
integer_: KL_INTEGER_ROUTINES

-- Routines that ought to be in class INTEGER

-- (From KL_IMPORTED_INTEGER_ROUTINES)

ensure
integer_routines_not_void: Result /= Void
platform: KL_PLATFORM

-- Platform-dependent properties

-- (From KL_SHARED_PLATFORM)

ensure
platform_not_void: Result /= Void
string_: KL_STRING_ROUTINES

-- Routines that ought to be in class STRING

-- (From KL_IMPORTED_STRING_ROUTINES)

ensure
string_routines_not_void: Result /= Void
code: INTEGER

-- Character code for current entity

unicode: UC_UNICODE_ROUTINES

-- Unicode routines

-- (From UC_IMPORTED_UNICODE_ROUTINES)

ensure
unicode_not_void: Result /= Void
utf8: UC_UTF8_ROUTINES

-- UTF-8 encoding routines

-- (From UC_IMPORTED_UTF8_ROUTINES)

ensure
utf8_not_void: Result /= Void

feature -- Status report

is_ascii: BOOLEAN

-- Is this entity representing an ASCII character?

ensure
definition: Result = (code <= 127)
is_valid: BOOLEAN

-- Is this entity representing a valid XML character?

ensure
valid_unicode: Result implies unicode.valid_code (code)

feature -- Conversion

to_character: CHARACTER

-- Character represented by entity

require
is_valid: is_valid
small_enough: code <= Platform.Maximum_character_code
ensure
same_code: Result.code = code
to_utf8: STRING

-- UTF-8 string from character code

require
valid: is_valid
ensure
to_utf8_not_void: Result /= Void
string_type: ANY_.same_types (Result,
)
valid_utf8: utf8.valid_utf8 (Result)

feature -- Obsolete

as_character: CHARACTER

-- Character represented by entity

obsolete

[020814] Use to_character instead.

require
is_valid: is_valid
small_enough: code <= Platform.Maximum_character_code
ensure
same_code: Result.code = code
as_string: STRING

-- UTF-8 string from character code

obsolete

[020814] Use to_utf8 instead.

require
valid: is_valid
ensure
to_utf8_not_void: Result /= Void
string_type: ANY_.same_types (Result,
)
valid_utf8: utf8.valid_utf8 (Result)
platform_: KL_PLATFORM

-- Platform-dependent properties

-- (From KL_SHARED_PLATFORM)

obsolete

[040101] Use Platform instead.

ensure
platform_not_void: Result /= Void

invariant

code_positive: code >= 0

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

end