note
	description: "References to objects containing a character value"
	library: "Free implementation of ELKS library"
	status: "See notice at end of class."
	legal: "See notice at end of class."
	date: "$Date: 2020-06-11 19:52:41 +0000 (Thu, 11 Jun 2020) $"
	revision: "$Revision: 104466 $"

class interface
	CHARACTER_8_REF

create 
	default_create

feature -- Access

	item: CHARACTER_8
			-- Character value

	natural_32_code: NATURAL_32
			-- Associated natural value

	hash_code: INTEGER_32
			-- Hash code value

	Min_value: INTEGER_32 = 0

	Max_value: INTEGER_32 = 255

	Max_ascii_value: INTEGER_32 = 127
			-- Bounds for integer representation of characters (ASCII)
	
feature -- Comparison

	is_less alias "<" (other: like Current): BOOLEAN
			-- Is other greater than current character?
		ensure then
			definition: Result = (natural_32_code < other.natural_32_code)

	is_equal (other: like Current): BOOLEAN
			-- Is other attached to an object of the same type
			-- as current object and identical to it?
	
feature -- Basic routines

	plus alias "+" (incr: INTEGER_32): CHARACTER_8
			-- Add incr to the code of item
		require
			valid_increment: (item.code + incr).is_valid_character_8_code
		ensure
			valid_result: Result |-| item = incr

	minus alias "-" alias "" (decr: INTEGER_32): CHARACTER_8
			-- Subtract decr from the code of item
		require
			valid_decrement: (item.code - decr).is_valid_character_8_code
		ensure
			valid_result: item |-| Result = decr

	difference alias "|-|" (other: CHARACTER_8): INTEGER_32
			-- Difference between the codes of item and other
		ensure
			valid_result: other + Result = item

	next: CHARACTER_8
			-- Next character
		require
			valid_character: (item.code + 1).is_valid_character_8_code
		ensure
			valid_result: Result |-| item = 1

	previous: CHARACTER_8
			-- Previous character
		require
			valid_character: (item.code - 1).is_valid_character_8_code
		ensure
			valid_result: Result |-| item = -1
	
feature -- Element change

	set_item (c: CHARACTER_8)
			-- Make c the item value.
	
feature -- Output

	out: STRING_8
			-- Printable representation of character
	
feature -- Conversion

	to_reference: CHARACTER_8_REF
			-- Associated reference of Current
		ensure
			to_reference_not_void: Result /= Void

	to_character_8: CHARACTER_8
			-- Associated character in 8 bit version

	to_character_32: CHARACTER_32
			-- Associated character in 32 bit version

	as_upper: CHARACTER_8
			-- Uppercase value of item.
			-- Returns item if not is_lower.
			-- Caveat: not all upper-case values fit into CHARACTER_8. Use CHARACTER_32 instead.
			-- Was declared in CHARACTER_8_REF as synonym of upper.

	upper: CHARACTER_8
			-- Uppercase value of item.
			-- Returns item if not is_lower.
			-- Caveat: not all upper-case values fit into CHARACTER_8. Use CHARACTER_32 instead.
			-- Was declared in CHARACTER_8_REF as synonym of as_upper.

	as_lower: CHARACTER_8
			-- Lowercase value of item
			-- Returns item if not is_upper
			-- Was declared in CHARACTER_8_REF as synonym of lower.

	lower: CHARACTER_8
			-- Lowercase value of item
			-- Returns item if not is_upper
			-- Was declared in CHARACTER_8_REF as synonym of as_lower.
	
feature -- Status report

	is_alpha: BOOLEAN
			-- Is item alphabetic?
			-- Alphabetic is is_upper or is_lower

	is_upper: BOOLEAN
			-- Is item uppercase?

	is_lower: BOOLEAN
			-- Is item lowercase?

	is_digit: BOOLEAN
			-- Is item a digit?
			-- A digit is one of 0123456789

	is_hexa_digit: BOOLEAN
			-- Is item an hexadecimal digit?
			-- A digit is one of 0123456789ABCDEFabcedf

	is_space: BOOLEAN
			-- Is item a white space?

	is_punctuation: BOOLEAN
			-- Is item a punctuation?

	is_alpha_numeric: BOOLEAN
			-- Is item alphabetic or a digit?

	is_printable: BOOLEAN
			-- Is item a printable character including space?

	is_graph: BOOLEAN
			-- Is item a printable character except space?

	is_control: BOOLEAN
			-- Is item a control character?
	
note
	copyright: "Copyright (c) 1984-2020, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		5949 Hollister Ave., Goleta, CA 93117 USA
		Telephone 805-685-1006, Fax 805-685-6869
		Website http://www.eiffel.com
		Customer support http://support.eiffel.com
	]"

end -- class CHARACTER_8_REF

Generated by ISE EiffelStudio