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.



82
83
84
# File 'lib/ffi/clang/compilation_database.rb', line 82

def initialize(pointer)
	@pointer = pointer
end

Instance Method Details

#arg(i) ⇒ Object



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

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

#argsObject



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

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

#directoryObject



86
87
88
# File 'lib/ffi/clang/compilation_database.rb', line 86

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

#mapped_source_content(i) ⇒ Object

Raises:

  • (NotImplementedError)


112
113
114
115
# File 'lib/ffi/clang/compilation_database.rb', line 112

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)


107
108
109
110
# File 'lib/ffi/clang/compilation_database.rb', line 107

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

#mapped_sourcesObject



117
118
119
120
121
# File 'lib/ffi/clang/compilation_database.rb', line 117

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

#num_argsObject



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

def num_args
	Lib.compile_command_get_num_args(@pointer)
end

#num_mapped_sourcesObject

Raises:

  • (NotImplementedError)


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

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