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.
-
#filename ⇒ Object
Get the filename associated with 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.
105 106 107 |
# File 'lib/ffi/clang/compilation_database.rb', line 105 def initialize(pointer) @pointer = pointer end |
Instance Method Details
#arg(i) ⇒ Object
Get an argument by index.
130 131 132 |
# File 'lib/ffi/clang/compilation_database.rb', line 130 def arg(i) Lib.extract_string Lib.compile_command_get_arg(@pointer, i) end |
#args ⇒ Object
Get all arguments.
136 137 138 |
# File 'lib/ffi/clang/compilation_database.rb', line 136 def args num_args.times.map{|i| arg(i)} end |
#directory ⇒ Object
Get the working directory for the command.
111 112 113 |
# File 'lib/ffi/clang/compilation_database.rb', line 111 def directory Lib.extract_string Lib.compile_command_get_directory(@pointer) end |
#filename ⇒ Object
Get the filename associated with the command.
117 118 119 |
# File 'lib/ffi/clang/compilation_database.rb', line 117 def filename Lib.extract_string Lib.compile_command_get_filename(@pointer) end |
#mapped_source_content(i) ⇒ Object
Get mapped source content by index.
156 157 158 |
# File 'lib/ffi/clang/compilation_database.rb', line 156 def mapped_source_content(i) 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.
149 150 151 |
# File 'lib/ffi/clang/compilation_database.rb', line 149 def mapped_source_path(i) Lib.extract_string Lib.compile_command_get_mapped_source_path(@pointer, i) end |
#mapped_sources ⇒ Object
Get all mapped sources.
162 163 164 165 166 |
# File 'lib/ffi/clang/compilation_database.rb', line 162 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.
123 124 125 |
# File 'lib/ffi/clang/compilation_database.rb', line 123 def num_args Lib.compile_command_get_num_args(@pointer) end |
#num_mapped_sources ⇒ Object
Get the number of mapped sources.
142 143 144 |
# File 'lib/ffi/clang/compilation_database.rb', line 142 def num_mapped_sources Lib.compile_command_get_num_mapped_sources(@pointer) end |