indexing
	description: "COM VARIANT structure"
	legal: "See notice at end of class."
	status: "See notice at end of class."
	date: "$Date: 2006-08-12 20:35:13 -0700 (Sat, 12 Aug 2006) $"
	revision: "$Revision: 62480 $"

class interface
	ECOM_VARIANT


create 
	make
			-- Create new variant.
		require -- from  WEL_STRUCTURE
			True
		ensure -- from WEL_STRUCTURE
			not_shared: not shared

	make_from_pointer (a_pointer: POINTER)
			-- Make from pointer.
		require -- from ECOM_STRUCTURE
			valid_pointer: a_pointer /= default_pointer

	make_from_character (a_value: CHARACTER_8)
			-- Initialize instance with character `a_value'.
		ensure
			character: character_value = a_value

	make_from_integer (a_value: INTEGER_32)
			-- Initialize instance with integer `a_value'.
		ensure
			integer: integer_value = a_value

	make_from_real (a_value: REAL_32)
			-- Initialize instance with real `a_value'.
		ensure
			real: real_value = a_value

	make_from_double (a_value: REAL_64)
			-- Make from double `a_value'.
		ensure
			double: double_value = a_value

	make_from_boolean (a_value: BOOLEAN)
			-- Initialize instance with boolean `a_value'.
		ensure
			boolean: boolean_value = a_value

	make_from_date (a_value: DATE_TIME)
			-- Initialize instance with date `a_value'.
		ensure
			date: date_value.is_equal (a_value)

	make_from_error (a_value: ECOM_HRESULT)
			-- Initialize instance with scode `a_value'.
		ensure
			error: error.is_equal (a_value)

	make_from_decimal (a_value: ECOM_DECIMAL)
			-- Initialize instance with decimal `a_value'.
		ensure
			decimal: decimal.is_equal (a_value)

	make_from_currency (a_value: ECOM_CURRENCY)
			-- Initialize instance with currency `a_value'.
		ensure
			currency: currency.is_equal (a_value)

	make_from_string (a_value: STRING_8)
			-- Initialize instance with string `a_value'.
		ensure
			string: string_value.is_equal (a_value)

	make_from_variant (a_value: ECOM_VARIANT)
			-- Initialize instance with variant `a_value'.
		ensure
			variant_value: variant_value.is_equal (a_value)

	make_from_iunknown (a_value: ECOM_INTERFACE)
			-- Initialize instance with IUnknown interface `a_value'.
		ensure
			iunknown: iunknown.item = a_value.item

	make_from_integer_array (a_value: ECOM_ARRAY [INTEGER_32])
			-- Initialize instance with integer array `a_value'.
		ensure
			integer_array: integer_array.is_equal (a_value)

	make_from_real_array (a_value: ECOM_ARRAY [REAL_32])
			-- Initialize instance with real array `a_value'.
		ensure
			real_array: real_array.is_equal (a_value)

	make_from_double_array (a_value: ECOM_ARRAY [REAL_64])
			-- Initialize instance with double array `a_value'.
		ensure
			double_array: double_array.is_equal (a_value)

	make_from_char_array (a_value: ECOM_ARRAY [CHARACTER_8])
			-- Initialize instance with char array `a_value'.
		ensure
			char_array: char_array.is_equal (a_value)

	make_from_error_array (a_value: ECOM_ARRAY [ECOM_HRESULT])
			-- Initialize instance with scode array `a_value'.
		ensure
			error_array: arrays_equal (error_array, a_value)

	make_from_currency_array (a_value: ECOM_ARRAY [ECOM_CURRENCY])
			-- Initialize instance with currency array `a_value'.
		ensure
			currency_array: arrays_equal (currency_array, a_value)

	make_from_date_array (a_value: ECOM_ARRAY [DATE_TIME])
			-- Initialize instance with date array `a_value'.
		ensure
			date_array: arrays_equal (date_array, a_value)

	make_from_string_array (a_value: ECOM_ARRAY [STRING_8])
			-- Initialize instance with string array `a_value'.
		ensure
			string_array: arrays_equal (string_array, a_value)

	make_from_boolean_array (a_value: ECOM_ARRAY [BOOLEAN])
			-- Initialize instance with boolean array `a_value'.
		ensure
			boolean_array: boolean_array.is_equal (a_value)

	make_from_decimal_array (a_value: ECOM_ARRAY [ECOM_DECIMAL])
			-- Initialize instance with decimal array `a_value'.
		ensure
			decimal_array: arrays_equal (decimal_array, a_value)

convert
	make_from_decimal_array ({POINTER}),
	make_from_decimal_array ({CHARACTER_8}),
	make_from_decimal_array ({INTEGER_32}),
	make_from_decimal_array ({REAL_32}),
	make_from_decimal_array ({REAL_64}),
	make_from_decimal_array ({BOOLEAN}),
	make_from_decimal_array ({DATE_TIME}),
	make_from_decimal_array ({ECOM_HRESULT}),
	make_from_decimal_array ({ECOM_DECIMAL}),
	make_from_decimal_array ({ECOM_CURRENCY}),
	make_from_decimal_array ({STRING_8}),
	make_from_decimal_array ({ECOM_INTERFACE}),
	make_from_decimal_array ({ECOM_ARRAY [INTEGER_32]}),
	make_from_decimal_array ({ECOM_ARRAY [REAL_32]}),
	make_from_decimal_array ({ECOM_ARRAY [REAL_64]}),
	make_from_decimal_array ({ECOM_ARRAY [BOOLEAN]}),
	make_from_decimal_array ({ECOM_ARRAY [CHARACTER_8]}),
	make_from_decimal_array ({ECOM_ARRAY [ECOM_HRESULT]}),
	make_from_decimal_array ({ECOM_ARRAY [ECOM_CURRENCY]}),
	make_from_decimal_array ({ECOM_ARRAY [DATE_TIME]}),
	make_from_decimal_array ({ECOM_ARRAY [STRING_8]}),
	make_from_decimal_array ({ECOM_ARRAY [ECOM_DECIMAL]})

feature -- Initialization

	make
			-- Create new variant.
		require -- from  WEL_STRUCTURE
			True
		ensure -- from WEL_STRUCTURE
			not_shared: not shared

	make_from_boolean (a_value: BOOLEAN)
			-- Initialize instance with boolean `a_value'.
		ensure
			boolean: boolean_value = a_value

	make_from_boolean_array (a_value: ECOM_ARRAY [BOOLEAN])
			-- Initialize instance with boolean array `a_value'.
		ensure
			boolean_array: boolean_array.is_equal (a_value)

	make_from_char_array (a_value: ECOM_ARRAY [CHARACTER_8])
			-- Initialize instance with char array `a_value'.
		ensure
			char_array: char_array.is_equal (a_value)

	make_from_character (a_value: CHARACTER_8)
			-- Initialize instance with character `a_value'.
		ensure
			character: character_value = a_value

	make_from_currency (a_value: ECOM_CURRENCY)
			-- Initialize instance with currency `a_value'.
		ensure
			currency: currency.is_equal (a_value)

	make_from_currency_array (a_value: ECOM_ARRAY [ECOM_CURRENCY])
			-- Initialize instance with currency array `a_value'.
		ensure
			currency_array: arrays_equal (currency_array, a_value)

	make_from_date (a_value: DATE_TIME)
			-- Initialize instance with date `a_value'.
		ensure
			date: date_value.is_equal (a_value)

	make_from_date_array (a_value: ECOM_ARRAY [DATE_TIME])
			-- Initialize instance with date array `a_value'.
		ensure
			date_array: arrays_equal (date_array, a_value)

	make_from_decimal (a_value: ECOM_DECIMAL)
			-- Initialize instance with decimal `a_value'.
		ensure
			decimal: decimal.is_equal (a_value)

	make_from_decimal_array (a_value: ECOM_ARRAY [ECOM_DECIMAL])
			-- Initialize instance with decimal array `a_value'.
		ensure
			decimal_array: arrays_equal (decimal_array, a_value)

	make_from_double (a_value: REAL_64)
			-- Make from double `a_value'.
		ensure
			double: double_value = a_value

	make_from_double_array (a_value: ECOM_ARRAY [REAL_64])
			-- Initialize instance with double array `a_value'.
		ensure
			double_array: double_array.is_equal (a_value)

	make_from_error (a_value: ECOM_HRESULT)
			-- Initialize instance with scode `a_value'.
		ensure
			error: error.is_equal (a_value)

	make_from_error_array (a_value: ECOM_ARRAY [ECOM_HRESULT])
			-- Initialize instance with scode array `a_value'.
		ensure
			error_array: arrays_equal (error_array, a_value)

	make_from_integer (a_value: INTEGER_32)
			-- Initialize instance with integer `a_value'.
		ensure
			integer: integer_value = a_value

	make_from_integer_array (a_value: ECOM_ARRAY [INTEGER_32])
			-- Initialize instance with integer array `a_value'.
		ensure
			integer_array: integer_array.is_equal (a_value)

	make_from_iunknown (a_value: ECOM_INTERFACE)
			-- Initialize instance with IUnknown interface `a_value'.
		ensure
			iunknown: iunknown.item = a_value.item

	make_from_pointer (a_pointer: POINTER)
			-- Make from pointer.
		require -- from ECOM_STRUCTURE
			valid_pointer: a_pointer /= default_pointer

	make_from_real (a_value: REAL_32)
			-- Initialize instance with real `a_value'.
		ensure
			real: real_value = a_value

	make_from_real_array (a_value: ECOM_ARRAY [REAL_32])
			-- Initialize instance with real array `a_value'.
		ensure
			real_array: real_array.is_equal (a_value)

	make_from_string (a_value: STRING_8)
			-- Initialize instance with string `a_value'.
		ensure
			string: string_value.is_equal (a_value)

	make_from_string_array (a_value: ECOM_ARRAY [STRING_8])
			-- Initialize instance with string array `a_value'.
		ensure
			string_array: arrays_equal (string_array, a_value)

	make_from_variant (a_value: ECOM_VARIANT)
			-- Initialize instance with variant `a_value'.
		ensure
			variant_value: variant_value.is_equal (a_value)
	
feature -- Access

	boolean_array: ECOM_ARRAY [BOOLEAN]
			-- ARRAY of BOOLEAN.
		require
			has_boolean: has_boolean (variable_type)
			is_array: is_array (variable_type)

	boolean_array_reference: CELL [ECOM_ARRAY [BOOLEAN]]
			-- ARRAY of BOOLEAN.
		require
			has_boolean: has_boolean (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	boolean_reference: BOOLEAN_REF
			-- Reference boolean value
		require
			is_boolean_ref: is_boolean (variable_type) and is_byref (variable_type)

	boolean_value: BOOLEAN
			-- Boolean value
		require
			is_boolean: variable_type = vt_bool

	char_array: ECOM_ARRAY [CHARACTER_8]
			-- ARRAY of characters
		require
			has_character: has_character (variable_type)
			is_array: is_array (variable_type)

	char_array_reference: CELL [ECOM_ARRAY [CHARACTER_8]]
			-- ARRAY of characters
		require
			has_character: has_character (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	character_reference: CHARACTER_8_REF
			-- Reference character value
		require
			is_character_ref: is_character (variable_type) and is_byref (variable_type)

	character_value: CHARACTER_8
			-- Character value
		require
			is_character: variable_type = vt_i1

	currency: ECOM_CURRENCY
			-- Currency value
		require
			is_currency: variable_type = vt_cy

	currency_array: ECOM_ARRAY [ECOM_CURRENCY]
			-- ARRAY of CURRENCY
		require
			has_currency: has_currency (variable_type)
			is_array: is_array (variable_type)

	currency_array_reference: CELL [ECOM_ARRAY [ECOM_CURRENCY]]
			-- ARRAY of CURRENCY
		require
			has_currency: has_currency (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	currency_reference: ECOM_CURRENCY
			-- Reference currency value
		require
			is_currency_ref: is_currency (variable_type) and is_byref (variable_type)

	date_array: ECOM_ARRAY [DATE_TIME]
			-- ARRAY of DATE
		require
			has_date: has_date (variable_type)
			is_array: is_array (variable_type)

	date_array_reference: CELL [ECOM_ARRAY [DATE_TIME]]
			-- ARRAY of DATE
		require
			has_date: has_date (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	date_reference: CELL [DATE_TIME]
			-- Date reference value
		require
			is_date_ref: is_date (variable_type) and is_byref (variable_type)

	date_value: DATE_TIME
			-- Date value
		require
			is_date: variable_type = vt_date

	decimal: ECOM_DECIMAL
			-- Decimal value

	decimal_array: ECOM_ARRAY [ECOM_DECIMAL]
			-- ARRAY of ECOM_DECIMALs.
		require
			has_decimal: has_decimal (variable_type)
			is_array: is_array (variable_type)

	decimal_array_reference: CELL [ECOM_ARRAY [ECOM_DECIMAL]]
			-- ARRAY of ECOM_DECIMALs.
		require
			has_decimal: has_decimal (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	decimal_reference: ECOM_DECIMAL
			-- Decimal reference value
		require
			is_decimal_ref: is_decimal (variable_type) and is_byref (variable_type)

	double_array: ECOM_ARRAY [REAL_64]
			-- ARRAY of doubles
		require
			has_double: has_double (variable_type)
			is_array: is_array (variable_type)

	double_array_reference: CELL [ECOM_ARRAY [REAL_64]]
			-- ARRAY of doubles
		require
			has_double: has_double (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	double_reference: REAL_64_REF
			-- Reference double value
		require
			is_double_ref: is_double (variable_type) and is_byref (variable_type)

	double_value: REAL_64
			-- Double value
		require
			is_double: variable_type = vt_r8

	error: ECOM_HRESULT
			-- Error value
		require
			is_error: variable_type = vt_error

	error_array: ECOM_ARRAY [ECOM_HRESULT]
			-- ARRAY of HRESULTs
		require
			has_error: has_error (variable_type)
			is_array: is_array (variable_type)

	error_array_reference: CELL [ECOM_ARRAY [ECOM_HRESULT]]
			-- ARRAY of HRESULTs
		require
			has_error: has_error (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	error_reference: ECOM_HRESULT
			-- Error reference value
		require
			is_error_ref: is_error (variable_type) and is_byref (variable_type)

	generating_type: STRING_8
			-- Name of current object's generating type
			-- (type of which it is a direct instance)
			-- (from ANY)
		ensure -- from ANY
			generating_type_not_void: Result /= Void
			generating_type_not_empty: not Result.is_empty

	generator: STRING_8
			-- Name of current object's generating class
			-- (base class of the type of which it is a direct instance)
			-- (from ANY)
		ensure -- from ANY
			generator_not_void: Result /= Void
			generator_not_empty: not Result.is_empty

	idispatch: ECOM_AUTOMATION_INTERFACE
			-- IDispatch interface value
		require
			is_idispatch: is_idispatch (variable_type)

	idispatch_array: ECOM_ARRAY [ECOM_AUTOMATION_INTERFACE]
			-- ARRAY of ECOM_AUTOMATION_INTERFACEs.
		require
			has_idispatch: has_idispatch (variable_type)
			is_array: is_array (variable_type)

	idispatch_array_reference: CELL [ECOM_ARRAY [ECOM_AUTOMATION_INTERFACE]]
			-- ARRAY of ECOM_AUTOMATION_INTERFACEs.
		require
			has_idispatch: has_idispatch (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	idispatch_reference: CELL [ECOM_AUTOMATION_INTERFACE]
			-- IDispatch interface reference value
		require
			is_idispatch_ref: has_idispatch (variable_type) and is_byref (variable_type)

	integer2: INTEGER_32
			-- Short value
		require
			is_integer2: variable_type = vt_i2

	integer2_reference: INTEGER_32_REF
			-- Reference short value
		require
			is_integer2_ref: is_integer2 (variable_type) and is_byref (variable_type)

	integer4: INTEGER_32
			-- Long value
		require
			is_integer4: variable_type = vt_i4

	integer4_array: ECOM_ARRAY [INTEGER_32]
			-- Integer ARRAY value
		require
			has_integer4: has_integer4 (variable_type)
			is_array: is_array (variable_type)

	integer4_array_reference: CELL [ECOM_ARRAY [INTEGER_32]]
			-- Reference integer ARRAY value
		require
			has_integer4: has_integer4 (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	integer4_reference: INTEGER_32_REF
			-- Reference long value
		require
			is_integer4_ref: is_integer4 (variable_type) and is_byref (variable_type)

	integer_array: ECOM_ARRAY [INTEGER_32]
			-- Array of integers
		require
			has_int: has_int (variable_type)
			is_array: is_array (variable_type)

	integer_array_reference: CELL [ECOM_ARRAY [INTEGER_32]]
			-- Array of integers
		require
			has_int: has_int (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	integer_reference: INTEGER_32_REF
			-- Reference integer value
		require
			is_integer_ref: is_int (variable_type) and is_byref (variable_type)

	integer_value: INTEGER_32
			-- Integer value
		require
			is_integer: variable_type = vt_int

	item: POINTER
			-- Generic Windows handle or structure pointer.
			-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
			-- (from WEL_ANY)

	iunknown: ECOM_UNKNOWN_INTERFACE
			-- IUnknown interface value
		require
			is_iunknown: is_iunknown (variable_type)

	iunknown_array: ECOM_ARRAY [ECOM_UNKNOWN_INTERFACE]
			-- ARRAY of ECOM_UNKNOWN_INTERFACEs.
		require
			has_iunknown: has_iunknown (variable_type)
			is_array: is_array (variable_type)

	iunknown_array_reference: CELL [ECOM_ARRAY [ECOM_UNKNOWN_INTERFACE]]
			-- ARRAY of ECOM_UNKNOWN_INTERFACEs.
		require
			has_iunknown: has_iunknown (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	iunknown_reference: CELL [ECOM_UNKNOWN_INTERFACE]
			-- IUnknown interface reference value
		require
			is_unknown_ref: has_iunknown (variable_type) and is_byref (variable_type)

	real_array: ECOM_ARRAY [REAL_32]
			-- ARRAY of reals
		require
			has_real: has_real (variable_type)
			is_array: is_array (variable_type)

	real_array_reference: CELL [ECOM_ARRAY [REAL_32]]
			-- ARRAY of reals
		require
			has_real: has_real (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	real_reference: REAL_32_REF
			-- Reference real value
		require
			is_real_ref: is_real (variable_type) and is_byref (variable_type)

	real_value: REAL_32
			-- Real value
		require
			is_real: variable_type = vt_r4

	short_array: ECOM_ARRAY [INTEGER_32]
			-- Integer ARRAY value
		require
			has_integer2: has_integer2 (variable_type)
			is_array: is_array (variable_type)

	short_array_reference: CELL [ECOM_ARRAY [INTEGER_32]]
			-- Integer ARRAY value
		require
			has_integer2: has_integer2 (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	string_array: ECOM_ARRAY [STRING_8]
			-- ARRAY of STRING.
		require
			has_bstr: has_bstr (variable_type)
			is_array: is_array (variable_type)

	string_array_reference: CELL [ECOM_ARRAY [STRING_8]]
			-- ARRAY of STRING.
		require
			has_bstr: has_bstr (variable_type)
			is_array: is_array (variable_type)
			is_byref: is_byref (variable_type)

	string_reference: CELL [STRING_8]
			-- Reference BSTR value
		require
			is_bstr_ref: is_bstr (variable_type) and is_byref (variable_type)

	string_value: STRING_8
			-- BSTR value
		require
			is_bstr: variable_type = vt_bstr

	unsigned_character_array: ECOM_ARRAY [CHARACTER_8]
			-- Array of unsigned character
		require
			has_unsigned_char: has_unsigned_char (variable_type)
			is_array: is_array (variable_type)

	unsigned_character_array_reference: CELL [ECOM_ARRAY [CHARACTER_8]]
			--