mirror of https://gitlab.com/cppit/libclangmm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
597 B
23 lines
597 B
|
11 years ago
|
#include "CompileCommands.h"
|
||
|
|
|
||
|
|
clang::CompileCommands::
|
||
|
|
CompileCommands(const std::string &filename, CompilationDatabase *db) {
|
||
|
|
commands_ =
|
||
|
|
clang_CompilationDatabase_getCompileCommands(db->db_, filename.c_str());
|
||
|
|
}
|
||
|
|
|
||
|
|
clang::CompileCommands::
|
||
|
|
~CompileCommands() {
|
||
|
|
clang_CompileCommands_dispose(commands_);
|
||
|
|
}
|
||
|
|
|
||
|
|
std::vector<clang::CompileCommand> clang::CompileCommands::
|
||
|
|
get_commands() {
|
||
|
|
unsigned N = clang_CompileCommands_getSize(commands_);
|
||
|
|
std::vector<clang::CompileCommand> res;
|
||
|
|
for (auto i = 0; i < N; i++) {
|
||
|
|
res.emplace_back(clang::CompileCommand(i, this));
|
||
|
|
}
|
||
|
|
return res;
|
||
|
|
}
|