note
	description: "Routines for cased variants of Unicode 5.1.0 characters"
	library: "Gobo Eiffel Kernel Library"
	copyright: "Copyright (c) 2008-2018, Colin Adams and others"
	license: "MIT License"
	date: "$Date: 2019-02-07 22:54:15 +0000 (Thu, 07 Feb 2019) $"
	revision: "$Revision: 102807 $"

class 
	UC_V510_CTYPE

inherit
	UC_V510_CTYPE_LOWERCASE
		export
			{NONE} all
		end

	UC_V510_CTYPE_UPPERCASE
		export
			{NONE} all
		undefine
			Major_version,
			Minor_version,
			Update_version
		end

	UC_V510_CTYPE_TITLECASE
		export
			{NONE} all
		undefine
			Major_version,
			Minor_version,
			Update_version
		end

	UC_UNICODE_CONSTANTS

create 
	default_create

feature -- Status report

	valid_code (a_code: INTEGER_32): BOOLEAN
			-- Is a_code a valid unicode?
		do
			Result := (a_code >= Minimum_unicode_character_code and a_code <= Maximum_unicode_character_code)
		ensure
			instance_free: class
			definition: Result = (a_code >= Minimum_unicode_character_code and a_code <= Maximum_unicode_character_code)
		end
	
feature -- Access

	lower_code (a_code_point: INTEGER_32): INTEGER_32
			-- Code of lower-case character of character with code a_code_point
		require
			valid_code: valid_code (a_code_point)
		local
			i, j, k, a_rem: INTEGER_32
		do
			i := a_code_point // (65536)
			a_rem := a_code_point \\ (65536)
			j := a_rem // 256
			k := a_rem \\ 256
			Result := Lower_codes.item (i).item (j).item (k + 1)
			if Result = -1 then
				Result := a_code_point
			end
		ensure
			instance_free: class
			valid_lower_code: valid_code (Result)
		end

	upper_code (a_code_point: INTEGER_32): INTEGER_32
			-- Code of upper-case character of character with code a_code_point
		require
			valid_code: valid_code (a_code_point)
		local
			i, j, k, a_rem: INTEGER_32
		do
			i := a_code_point // (65536)
			a_rem := a_code_point \\ (65536)
			j := a_rem // 256
			k := a_rem \\ 256
			Result := Upper_codes.item (i).item (j).item (k + 1)
			if Result = -1 then
				Result := a_code_point
			end
		ensure
			instance_free: class
			valid_upper_code: valid_code (Result)
		end

	title_code (a_code_point: INTEGER_32): INTEGER_32
			-- Code of title-case character of character with code a_code_point
		require
			valid_code: valid_code (a_code_point)
		local
			i, j, k, a_rem: INTEGER_32
		do
			i := a_code_point // (65536)
			a_rem := a_code_point \\ (65536)
			j := a_rem // 256
			k := a_rem \\ 256
			Result := Title_codes.item (i).item (j).item (k + 1)
			if Result = -1 then
				Result := a_code_point
			end
		ensure
			instance_free: class
			valid_title_code: valid_code (Result)
		end
	
end -- class UC_V510_CTYPE

Generated by ISE EiffelStudio