ccls/libclangmm/CompileCommand.cc

22 lines
623 B
C++
Raw Normal View History

2017-02-16 09:35:30 +00:00
#include "CompileCommand.h"
#include "CompileCommands.h"
#include "Utility.h"
std::string clang::CompileCommand::get_command() {
std::string res;
unsigned N = clang_CompileCommand_getNumArgs(cx_command);
for (unsigned i = 0; i < N; i++) {
2017-02-17 09:57:44 +00:00
res += ToString(clang_CompileCommand_getArg(cx_command, i));
2017-02-16 09:35:30 +00:00
}
return res;
}
std::vector<std::string> clang::CompileCommand::get_command_as_args() {
unsigned N = clang_CompileCommand_getNumArgs(cx_command);
std::vector<std::string> res(N);
for (unsigned i = 0; i < N; i++) {
2017-02-17 09:57:44 +00:00
res[i] = ToString(clang_CompileCommand_getArg(cx_command, i));
2017-02-16 09:35:30 +00:00
}
return res;
}