note
	description: "Objects that represent encodings and that provide conversion methods."
	legal: "See notice at end of class."
	status: "See notice at end of class."
	date: "$Date: 2020-05-20 10:46:14 +0000 (Wed, 20 May 2020) $"
	revision: "$Revision: 104297 $"

class interface
	ENCODING

create 
	make

feature -- Access

	code_page: READABLE_STRING_8
			-- Code page/Character set name.
			-- Immutable name.	

	last_converted_stream: STRING_8
			-- Stream representation of last converted string.
			-- Note: Original string object could be returned directly.
		require
			last_conversion_successful: last_conversion_successful
		ensure
			last_converted_stream_not_void: Result /= Void

	last_converted_string_8: STRING_8
			-- Last converted string.
			-- Note: Original string object could be returned directly.
		require
			last_conversion_successful: last_conversion_successful
		ensure
			last_converted_string_not_void: Result /= Void

	last_converted_string_32: STRING_32
			-- Last converted string.
			-- Note: Original string object could be returned directly.
		require
			last_conversion_successful: last_conversion_successful
		ensure
			last_converted_string_not_void: Result /= Void

	last_converted_string: READABLE_STRING_GENERAL
			-- Last converted string.
			-- Note: Original string object could be returned directly.
		require
			last_conversion_successful: last_conversion_successful
		ensure
			last_converted_string_not_void: Result /= Void
	
feature -- Conversion

	convert_to (a_to_encoding: ENCODING; a_string: READABLE_STRING_GENERAL)
			-- Convert a_string from current encoding to a_to_encoding.
			-- If either current or a_to_encoding is not is_valid, or an error occurs during conversion,
			-- last_conversion_successful is unset.
			-- Conversion result can be retrieved via last_converted_string or last_converted_stream.
		require
			a_to_encoding_not_void: a_to_encoding /= Void
			a_string_not_void: a_string /= Void
	
feature -- Status report

	last_conversion_successful: BOOLEAN
			-- Was last conversion successful?

	last_conversion_lost_data: BOOLEAN
			-- Has last conversion between two encodings lost data?
	
feature -- Comparison

	same_as (other: ENCODING): BOOLEAN
			-- Is Current same encoding as other?
	
invariant
	code_page_not_void: code_page /= Void
	encoding_i_not_void: encoding_i /= Void

note
	library: "Base: Library of reusable components for Eiffel."
	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 ENCODING

Generated by ISE EiffelStudio