Class: Fzeet::Windows::BSTR
- Inherits:
-
Object
- Object
- Fzeet::Windows::BSTR
- Defined in:
- lib/fzeet/windows/oleaut/Bstr.rb
Instance Attribute Summary collapse
-
#pointer ⇒ Object
readonly
Returns the value of attribute pointer.
Class Method Summary collapse
- .[](s) ⇒ Object (also: from)
Instance Method Summary collapse
- #free ⇒ Object (also: #dispose)
-
#initialize(pointer) ⇒ BSTR
constructor
A new instance of BSTR.
- #length ⇒ Object (also: #size)
- #multibyte ⇒ Object
Constructor Details
#initialize(pointer) ⇒ BSTR
Returns a new instance of BSTR.
20 |
# File 'lib/fzeet/windows/oleaut/Bstr.rb', line 20 def initialize(pointer) @pointer = pointer end |
Instance Attribute Details
#pointer ⇒ Object (readonly)
Returns the value of attribute pointer.
22 23 24 |
# File 'lib/fzeet/windows/oleaut/Bstr.rb', line 22 def pointer @pointer end |
Class Method Details
.[](s) ⇒ Object Also known as: from
6 7 8 9 10 11 12 13 14 |
# File 'lib/fzeet/windows/oleaut/Bstr.rb', line 6 def self.[](s) bstr = new(Windows.SysAllocString("#{s}\0".encode('utf-16le'))) if block_given? yield bstr; bstr.dispose; return nil end bstr end |
Instance Method Details
#free ⇒ Object Also known as: dispose
24 |
# File 'lib/fzeet/windows/oleaut/Bstr.rb', line 24 def free; Windows.SysFreeString(@pointer) end |
#length ⇒ Object Also known as: size
27 |
# File 'lib/fzeet/windows/oleaut/Bstr.rb', line 27 def length; Windows.SysStringLen(@pointer) end |
#multibyte ⇒ Object
30 |
# File 'lib/fzeet/windows/oleaut/Bstr.rb', line 30 def multibyte; Windows.WCSTOMBS(@pointer) end |