Class: Unknownr::Windows::PROPVARIANT
- Inherits:
-
FFI::Union
- Object
- FFI::Union
- Unknownr::Windows::PROPVARIANT
- Includes:
- AnonymousSupport
- Defined in:
- lib/unknownr.rb
Class Method Summary collapse
Instance Method Summary collapse
- #bool ⇒ Object
- #bool=(bool) ⇒ Object
- #decimal ⇒ Object
- #decimal=(decimal) ⇒ Object
- #int ⇒ Object
- #int=(int) ⇒ Object
- #uint ⇒ Object
- #uint=(uint) ⇒ Object
- #unknown ⇒ Object
- #unknown=(unknown) ⇒ Object
- #wstring ⇒ Object
- #wstring=(string) ⇒ Object
Methods included from AnonymousSupport
Class Method Details
.[](t, *v) ⇒ Object
644 |
# File 'lib/unknownr.rb', line 644 def self.[](t, *v) new.tap { |var| var.send("#{t}=", *v) } end |
Instance Method Details
#bool ⇒ Object
646 |
# File 'lib/unknownr.rb', line 646 def bool; raise 'Wrong type tag.' unless self[:vt] == VT_BOOL; self[:boolVal] != 0 end |
#bool=(bool) ⇒ Object
647 |
# File 'lib/unknownr.rb', line 647 def bool=(bool) self[:vt] = VT_BOOL; self[:boolVal] = (bool) ? -1 : 0 end |
#decimal ⇒ Object
677 678 679 680 681 |
# File 'lib/unknownr.rb', line 677 def decimal raise 'Wrong type tag.' unless self[:vt] == VT_DECIMAL Rational(self[:decVal][:Lo64], 10 ** self[:decVal][:scale]) + self[:decVal][:Hi32] end |
#decimal=(decimal) ⇒ Object
683 |
# File 'lib/unknownr.rb', line 683 def decimal=(decimal) self[:vt] = VT_DECIMAL; self[:decVal][:Lo64] = decimal end |
#int ⇒ Object
649 |
# File 'lib/unknownr.rb', line 649 def int; raise 'Wrong type tag.' unless self[:vt] == VT_I4; self[:intVal] end |
#int=(int) ⇒ Object
650 |
# File 'lib/unknownr.rb', line 650 def int=(int) self[:vt] = VT_I4; self[:intVal] = int end |
#uint ⇒ Object
652 |
# File 'lib/unknownr.rb', line 652 def uint; raise 'Wrong type tag.' unless self[:vt] == VT_UI4; self[:uintVal] end |
#uint=(uint) ⇒ Object
653 |
# File 'lib/unknownr.rb', line 653 def uint=(uint) self[:vt] = VT_UI4; self[:uintVal] = uint end |
#unknown ⇒ Object
655 656 657 658 659 660 661 |
# File 'lib/unknownr.rb', line 655 def unknown raise 'Wrong type tag.' unless self[:vt] == VT_UNKNOWN yield Unknown.new(self[:punkVal]) ensure Windows.PropVariantClear(self) end |
#unknown=(unknown) ⇒ Object
663 |
# File 'lib/unknownr.rb', line 663 def unknown=(unknown) self[:vt] = VT_UNKNOWN; self[:punkVal] = unknown.pointer; unknown.AddRef end |