Class: WinFFI::WideInlineString
- Inherits:
-
Object
- Object
- WinFFI::WideInlineString
- Includes:
- FFI::DataConverter
- Defined in:
- lib/win-ffi/core/wide_inline_string.rb
Instance Attribute Summary collapse
-
#native_type ⇒ Object
readonly
Returns the value of attribute native_type.
-
#size ⇒ Object
(also: #length)
readonly
Returns the value of attribute size.
Instance Method Summary collapse
- #from_native(value, _context) ⇒ Object
-
#initialize(size) ⇒ WideInlineString
constructor
A new instance of WideInlineString.
- #to_native(_value, _context) ⇒ Object
Constructor Details
#initialize(size) ⇒ WideInlineString
Returns a new instance of WideInlineString.
7 8 9 10 |
# File 'lib/win-ffi/core/wide_inline_string.rb', line 7 def initialize(size) @size = size @native_type = FFI::ArrayType.new(WinFFI.find_type(:tchar), size) end |
Instance Attribute Details
#native_type ⇒ Object (readonly)
Returns the value of attribute native_type.
5 6 7 |
# File 'lib/win-ffi/core/wide_inline_string.rb', line 5 def native_type @native_type end |
#size ⇒ Object (readonly) Also known as: length
Returns the value of attribute size.
5 6 7 |
# File 'lib/win-ffi/core/wide_inline_string.rb', line 5 def size @size end |
Instance Method Details
#from_native(value, _context) ⇒ Object
16 17 18 |
# File 'lib/win-ffi/core/wide_inline_string.rb', line 16 def from_native(value, _context) LibBase.string_from_byte_array(value.to_a) end |
#to_native(_value, _context) ⇒ Object
12 13 14 |
# File 'lib/win-ffi/core/wide_inline_string.rb', line 12 def to_native(_value, _context) raise NotImplementedError end |