Class: FFI::Clang::Cursor::PlatformAvailability

Inherits:
AutoPointer
  • Object
show all
Defined in:
lib/ffi/clang/cursor.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(memory_pointer) ⇒ PlatformAvailability

Returns a new instance of PlatformAvailability.



512
513
514
515
516
517
518
519
520
# File 'lib/ffi/clang/cursor.rb', line 512

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



522
523
524
525
# File 'lib/ffi/clang/cursor.rb', line 522

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

#deprecatedObject



535
536
537
# File 'lib/ffi/clang/cursor.rb', line 535

def deprecated
	@platform_availability[:deprecated]
end

#introducedObject



531
532
533
# File 'lib/ffi/clang/cursor.rb', line 531

def introduced
	@platform_availability[:introduced]
end

#messageObject



547
548
549
# File 'lib/ffi/clang/cursor.rb', line 547

def message
	Lib.get_string @platform_availability[:message]
end

#obsoletedObject



539
540
541
# File 'lib/ffi/clang/cursor.rb', line 539

def obsoleted
	@platform_availability[:obsoleted]
end

#platformObject



527
528
529
# File 'lib/ffi/clang/cursor.rb', line 527

def platform
	Lib.get_string @platform_availability[:platform]
end

#unavailableObject



543
544
545
# File 'lib/ffi/clang/cursor.rb', line 543

def unavailable
	@platform_availability[:unavailable] != 0
end