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.

28 lines
762 B

11 years ago
#include "CompileCommand.h"
#include "CompileCommands.h"
clang::CompileCommand::
CompileCommand(int nth, clang::CompileCommands *commands) {
command_ = clang_CompileCommands_getCommand(commands->commands_, nth);
}
std::string clang::CompileCommand::
get_command() {
std::string res;
unsigned N = clang_CompileCommand_getNumArgs(command_);
for (int i = 0; i < N; i++) {
res += clang_getCString(clang_CompileCommand_getArg(command_, i));
}
return res;
}
std::vector<std::string> clang::CompileCommand::
get_command_as_args() {
unsigned N = clang_CompileCommand_getNumArgs(command_);
std::vector<std::string> res(N);
for (int i = 0; i < N; i++) {
res[i] = clang_getCString(clang_CompileCommand_getArg(command_, i));
}
return res;
}