Browse Source

CompileCommand cleanup

merge-requests/37/head
eidheim 8 years ago
parent
commit
7ef30c8177
  1. 11
      src/CompileCommand.cc
  2. 3
      src/CompileCommand.h

11
src/CompileCommand.cc

@ -2,16 +2,7 @@
#include "CompileCommands.h" #include "CompileCommands.h"
#include "Utility.h" #include "Utility.h"
std::string clangmm::CompileCommand::get_command() { std::vector<std::string> clangmm::CompileCommand::get_arguments() {
std::string res;
unsigned N = clang_CompileCommand_getNumArgs(cx_command);
for (unsigned i = 0; i < N; i++) {
res += to_string(clang_CompileCommand_getArg(cx_command, i));
}
return res;
}
std::vector<std::string> clangmm::CompileCommand::get_command_as_args() {
unsigned N = clang_CompileCommand_getNumArgs(cx_command); unsigned N = clang_CompileCommand_getNumArgs(cx_command);
std::vector<std::string> res(N); std::vector<std::string> res(N);
for (unsigned i = 0; i < N; i++) { for (unsigned i = 0; i < N; i++) {

3
src/CompileCommand.h

@ -8,8 +8,7 @@ namespace clangmm {
class CompileCommand { class CompileCommand {
public: public:
CompileCommand(const CXCompileCommand& cx_command) : cx_command(cx_command) {}; CompileCommand(const CXCompileCommand& cx_command) : cx_command(cx_command) {};
std::string get_command(); std::vector<std::string> get_arguments();
std::vector<std::string> get_command_as_args();
CXCompileCommand cx_command; CXCompileCommand cx_command;
}; };

Loading…
Cancel
Save