Class: FFI::Clang::Cursor::PlatformAvailability
- Inherits:
-
AutoPointer
- Object
- AutoPointer
- FFI::Clang::Cursor::PlatformAvailability
- Defined in:
- lib/ffi/clang/cursor.rb
Overview
Represents platform availability information for a cursor.
Class Method Summary collapse
-
.release(pointer) ⇒ Object
Release the platform availability pointer.
Instance Method Summary collapse
-
#deprecated ⇒ Object
Get the version where the feature was deprecated.
-
#initialize(memory_pointer) ⇒ PlatformAvailability
constructor
Initialize platform availability from a memory pointer.
-
#introduced ⇒ Object
Get the version where the feature was introduced.
-
#message ⇒ Object
Get the availability message.
-
#obsoleted ⇒ Object
Get the version where the feature was obsoleted.
-
#platform ⇒ Object
Get the platform name.
-
#unavailable ⇒ Object
Check if the feature is unavailable.
Constructor Details
#initialize(memory_pointer) ⇒ PlatformAvailability
Initialize platform availability from a memory pointer.
738 739 740 741 742 743 744 745 746 |
# File 'lib/ffi/clang/cursor.rb', line 738 def initialize(memory_pointer) pointer = FFI::Pointer.new(memory_pointer) super(pointer) # I'm not sure this is safe. # Keep a reference to CXPlatformAvailability itself allocated by MemoryPointer. @memory_pointer = memory_pointer @platform_availability = Lib::CXPlatformAvailability.new(memory_pointer) end |
Class Method Details
.release(pointer) ⇒ Object
Release the platform availability pointer.
750 751 752 753 |
# File 'lib/ffi/clang/cursor.rb', line 750 def self.release(pointer) # Memory allocated by get_cursor_platform_availability is managed by AutoPointer. Lib.dispose_platform_availability(Lib::CXPlatformAvailability.new(pointer)) end |
Instance Method Details
#deprecated ⇒ Object
Get the version where the feature was deprecated.
775 776 777 |
# File 'lib/ffi/clang/cursor.rb', line 775 def deprecated @platform_availability[:deprecated] end |
#introduced ⇒ Object
Get the version where the feature was introduced.
769 770 771 |
# File 'lib/ffi/clang/cursor.rb', line 769 def introduced @platform_availability[:introduced] end |
#message ⇒ Object
Get the availability message.
793 794 795 |
# File 'lib/ffi/clang/cursor.rb', line 793 def Lib.get_string @platform_availability[:message] end |
#obsoleted ⇒ Object
Get the version where the feature was obsoleted.
781 782 783 |
# File 'lib/ffi/clang/cursor.rb', line 781 def obsoleted @platform_availability[:obsoleted] end |
#platform ⇒ Object
Get the platform name.
757 758 759 |
# File 'lib/ffi/clang/cursor.rb', line 757 def platform Lib.get_string @platform_availability[:platform] end |
#unavailable ⇒ Object
Check if the feature is unavailable.
787 788 789 |
# File 'lib/ffi/clang/cursor.rb', line 787 def unavailable @platform_availability[:unavailable] != 0 end |