Class: FFI::Clang::CompilationDatabase::CompileCommand

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

Instance Method Summary collapse

Constructor Details

#initialize(pointer) ⇒ CompileCommand

Returns a new instance of CompileCommand.



68
69
70
# File 'lib/ffi/clang/compilation_database.rb', line 68

def initialize(pointer)
	@pointer = pointer
end

Instance Method Details

#arg(i) ⇒ Object



80
81
82
# File 'lib/ffi/clang/compilation_database.rb', line 80

def arg(i)
	Lib.extract_string Lib.compile_command_get_arg(@pointer, i)
end

#argsObject



84
85
86
# File 'lib/ffi/clang/compilation_database.rb', line 84

def args
	num_args.times.map { |i| arg(i) }
end

#directoryObject



72
73
74
# File 'lib/ffi/clang/compilation_database.rb', line 72

def directory
	Lib.extract_string Lib.compile_command_get_directory(@pointer)
end

#mapped_source_content(i) ⇒ Object

Raises:

  • (NotImplementedError)


98
99
100
101
# File 'lib/ffi/clang/compilation_database.rb', line 98

def mapped_source_content(i)
	raise NotImplementedError
	# Lib.extract_string Lib.compile_command_get_mapped_source_content(@pointer, i)
end

#mapped_source_path(i) ⇒ Object

Raises:

  • (NotImplementedError)


93
94
95
96
# File 'lib/ffi/clang/compilation_database.rb', line 93

def mapped_source_path(i)
	raise NotImplementedError
	# Lib.extract_string Lib.compile_command_get_mapped_source_path(@pointer, i)
end

#mapped_sourcesObject



103
104
105
106
107
# File 'lib/ffi/clang/compilation_database.rb', line 103

def mapped_sources
	num_mapped_sources.times.map { |i|
		{path: mapped_source_path(i), content: mapped_source_content(i)}
	}
end

#num_argsObject



76
77
78
# File 'lib/ffi/clang/compilation_database.rb', line 76

def num_args
	Lib.compile_command_get_num_args(@pointer)
end

#num_mapped_sourcesObject

Raises:

  • (NotImplementedError)


88
89
90
91
# File 'lib/ffi/clang/compilation_database.rb', line 88

def num_mapped_sources
	raise NotImplementedError
	# Lib.compile_command_get_num_mapped_sources(@pointer)
end