Class: FFI::Clang::CompilationDatabase::CompileCommand
- Inherits:
-
Object
- Object
- FFI::Clang::CompilationDatabase::CompileCommand
- Defined in:
- lib/ffi/clang/compilation_database.rb
Overview
Represents a single compile command.
Instance Method Summary collapse
-
#arg(i) ⇒ Object
Get an argument by index.
-
#args ⇒ Object
Get all arguments.
-
#directory ⇒ Object
Get the working directory for the command.
-
#initialize(pointer) ⇒ CompileCommand
constructor
Initialize a compile command.
-
#mapped_source_content(i) ⇒ Object
Get mapped source content by index.
-
#mapped_source_path(i) ⇒ Object
Get a mapped source path by index.
-
#mapped_sources ⇒ Object
Get all mapped sources.
-
#num_args ⇒ Object
Get the number of arguments.
-
#num_mapped_sources ⇒ Object
Get the number of mapped sources.
Constructor Details
#initialize(pointer) ⇒ CompileCommand
Initialize a compile command.
99 100 101 |
# File 'lib/ffi/clang/compilation_database.rb', line 99 def initialize(pointer) @pointer = pointer end |
Instance Method Details
#arg(i) ⇒ Object
Get an argument by index.
118 119 120 |
# File 'lib/ffi/clang/compilation_database.rb', line 118 def arg(i) Lib.extract_string Lib.compile_command_get_arg(@pointer, i) end |
#args ⇒ Object
Get all arguments.
124 125 126 |
# File 'lib/ffi/clang/compilation_database.rb', line 124 def args num_args.times.map {|i| arg(i)} end |
#directory ⇒ Object
Get the working directory for the command.
105 106 107 |
# File 'lib/ffi/clang/compilation_database.rb', line 105 def directory Lib.extract_string Lib.compile_command_get_directory(@pointer) end |
#mapped_source_content(i) ⇒ Object
Get mapped source content by index.
149 150 151 152 |
# File 'lib/ffi/clang/compilation_database.rb', line 149 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
Get a mapped source path by index.
140 141 142 143 |
# File 'lib/ffi/clang/compilation_database.rb', line 140 def mapped_source_path(i) raise NotImplementedError # Lib.extract_string Lib.compile_command_get_mapped_source_path(@pointer, i) end |
#mapped_sources ⇒ Object
Get all mapped sources.
157 158 159 160 161 |
# File 'lib/ffi/clang/compilation_database.rb', line 157 def mapped_sources num_mapped_sources.times.map {|i| {path: mapped_source_path(i), content: mapped_source_content(i)} } end |
#num_args ⇒ Object
Get the number of arguments.
111 112 113 |
# File 'lib/ffi/clang/compilation_database.rb', line 111 def num_args Lib.compile_command_get_num_args(@pointer) end |
#num_mapped_sources ⇒ Object
Get the number of mapped sources.
131 132 133 134 |
# File 'lib/ffi/clang/compilation_database.rb', line 131 def num_mapped_sources raise NotImplementedError # Lib.compile_command_get_num_mapped_sources(@pointer) end |