FFI::ClangSourceFFIClangCursorSet

class CursorSet

Represents a libclang cursor set for fast cursor membership checks.

Definitions

def initialize

Create an empty cursor set.

Implementation

def initialize
	super Lib.create_cursor_set
end

def self.release(pointer)

Release the cursor set pointer.

Signature

parameter pointer FFI::Pointer

The cursor set pointer to release.

Implementation

def self.release(pointer)
	Lib.dispose_cursor_set(pointer)
end

def include?(cursor)

Check whether the set contains a cursor.

Signature

parameter cursor Cursor

The cursor to check.

returns Boolean

True if the cursor is present in the set.

Implementation

def include?(cursor)
	Lib.cursor_set_contains(self, cursor.cursor) != 0
end

def insert(cursor)

Insert a cursor into the set.

Signature

parameter cursor Cursor

The cursor to insert.

returns Boolean

True if the cursor was newly inserted.

Implementation

def insert(cursor)
	Lib.cursor_set_insert(self, cursor.cursor) != 0
end