Class: FFI::Clang::CompilationDatabase::CompileCommands

Inherits:
AutoPointer
  • Object
show all
Includes:
Enumerable
Defined in:
lib/ffi/clang/compilation_database.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pointer, database) ⇒ CompileCommands

Returns a new instance of CompileCommands.



39
40
41
42
# File 'lib/ffi/clang/compilation_database.rb', line 39

def initialize(pointer, database)
	super pointer
	@database = database
end

Class Method Details

.release(pointer) ⇒ Object



44
45
46
# File 'lib/ffi/clang/compilation_database.rb', line 44

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

Instance Method Details

#command(i) ⇒ Object



52
53
54
# File 'lib/ffi/clang/compilation_database.rb', line 52

def command(i)
	CompileCommand.new Lib.compile_commands_get_command(self, i)
end

#commandsObject



56
57
58
# File 'lib/ffi/clang/compilation_database.rb', line 56

def commands
	size.times.map { |i| command(i) }
end

#each(&block) ⇒ Object



60
61
62
63
64
# File 'lib/ffi/clang/compilation_database.rb', line 60

def each(&block)
	size.times.map do |i|
		block.call(command(i))
	end
end

#sizeObject



48
49
50
# File 'lib/ffi/clang/compilation_database.rb', line 48

def size
	Lib.compile_commands_get_size(self)
end