27 lines
800 B
C
27 lines
800 B
C
|
#pragma once
|
||
|
|
||
|
#include <json/json.h>
|
||
|
|
||
|
#include "vs_generate.h"
|
||
|
|
||
|
class JsonCommand {
|
||
|
public:
|
||
|
JsonCommand();
|
||
|
~JsonCommand();
|
||
|
|
||
|
public:
|
||
|
bool generate(const std::vector<ProjectInfo>& projs);
|
||
|
void set_expect(const std::string& exp);
|
||
|
void set_out(const std::string& out);
|
||
|
|
||
|
private:
|
||
|
std::string expect_{"expect"};
|
||
|
std::string out_{"compile_commands.json" };
|
||
|
std::string get_command(const ProjectInfo* proj, const std::vector<ProjectInfo>& projs);
|
||
|
static std::vector<std::string> get_cpp_paths(const std::string& parent_path);
|
||
|
static std::vector<std::string> split(const std::string& source,
|
||
|
const std::string& sep);
|
||
|
static void replaceAll(std::string& str, const std::string& from,
|
||
|
const std::string& to);
|
||
|
};
|