/
compilecommand_gen.go
42 lines (33 loc) · 1.1 KB
/
compilecommand_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package clang
// #include "./clang-c/CXCompilationDatabase.h"
// #include "go-clang.h"
import "C"
// CompileCommand represents the command line invocation to compile a specific file.
type CompileCommand struct {
c C.CXCompileCommand
}
// Directory get the working directory where the CompileCommand was executed from
func (cc CompileCommand) Directory() string {
o := cxstring{C.clang_CompileCommand_getDirectory(cc.c)}
defer o.Dispose()
return o.String()
}
// Filename get the filename associated with the CompileCommand.
func (cc CompileCommand) Filename() string {
o := cxstring{C.clang_CompileCommand_getFilename(cc.c)}
defer o.Dispose()
return o.String()
}
// NumArgs get the number of arguments in the compiler invocation.
func (cc CompileCommand) NumArgs() uint32 {
return uint32(C.clang_CompileCommand_getNumArgs(cc.c))
}
// Arg get the I'th argument value in the compiler invocations
//
// Invariant :
// - argument 0 is the compiler executable
func (cc CompileCommand) Arg(i uint32) string {
o := cxstring{C.clang_CompileCommand_getArg(cc.c, C.uint(i))}
defer o.Dispose()
return o.String()
}