class EL_MATLAB_STRING

(source code)

description

Matlab string

note
	description: "Matlab string"

	author: "Finnian Reilly"
	copyright: "Copyright (c) 2001-2022 Finnian Reilly"
	contact: "finnian at eiffel hyphen loop dot com"

	license: "MIT license (See: en.wikipedia.org/wiki/MIT_License)"
	date: "2022-11-15 19:56:05 GMT (Tuesday 15th November 2022)"
	revision: "5"

class
	EL_MATLAB_STRING

inherit
	EL_MATLAB_VECTOR [CHARACTER]
		rename
			make as make_vector
		redefine
			create_area, area
		end

create
	make

feature {NONE} -- Initialization

	make (string: STRING)
		--
		local
			c_string: ANY
		do
			c_string := string.to_c
			item := c_create_string ($c_string)
		end

	create_area
			--
		do
			count := c_get_rows (item)
			create area.make (c_get_data (item), count)
		end

feature {NONE} -- Inapplicable

	create_matrix (size: INTEGER): POINTER
			--
		do
		end

feature -- Contract support

	is_orientation_valid (mx_array: POINTER): BOOLEAN
			--
		do
			Result := true
		end

feature {NONE} -- Implementation

	mx_count: INTEGER
			--
		do
		end

	area: EL_MEMORY_CHARACTER_ARRAY

feature {NONE} -- C externals

	c_create_string (string: POINTER): POINTER
			-- Create 1-by-N string mxArray initialized to specified string

		external
			"C (const char *): EIF_POINTER | <matrix.h>"
		alias
			"mxCreateString"
		end

end