Added handling of query-driver target and using default driver for '.'
This commit is contained in:
@@ -43,6 +43,7 @@ void query_driver_output_extractor::execute()
|
||||
|
||||
system_include_paths_.clear();
|
||||
extract_system_include_paths(driver_output);
|
||||
extract_target(driver_output);
|
||||
|
||||
if (system_include_paths_.empty()) {
|
||||
throw query_driver_no_paths(fmt::format(
|
||||
@@ -55,6 +56,20 @@ void query_driver_output_extractor::execute()
|
||||
fmt::join(system_include_paths_, ","));
|
||||
}
|
||||
|
||||
void query_driver_output_extractor::extract_target(const std::string &output)
|
||||
{
|
||||
std::istringstream f(output);
|
||||
std::string line;
|
||||
|
||||
while (std::getline(f, line)) {
|
||||
line = trim(line);
|
||||
if (util::starts_with(line, std::string{"Target: "})) {
|
||||
target_ = line.substr(strlen("Target: "));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void query_driver_output_extractor::extract_system_include_paths(
|
||||
const std::string &output)
|
||||
{
|
||||
@@ -84,4 +99,8 @@ query_driver_output_extractor::system_include_paths() const
|
||||
return system_include_paths_;
|
||||
}
|
||||
|
||||
const std::string &query_driver_output_extractor::target() const
|
||||
{
|
||||
return target_;
|
||||
}
|
||||
} // namespace clanguml::util
|
||||
@@ -35,13 +35,18 @@ public:
|
||||
|
||||
void execute();
|
||||
|
||||
void extract_target(const std::string &output);
|
||||
|
||||
void extract_system_include_paths(const std::string &output);
|
||||
|
||||
const std::vector<std::string> &system_include_paths() const;
|
||||
|
||||
const std::string &target() const;
|
||||
|
||||
private:
|
||||
const std::string command_;
|
||||
const std::string language_;
|
||||
std::string target_;
|
||||
std::vector<std::string> system_include_paths_;
|
||||
};
|
||||
} // namespace clanguml::util
|
||||
Reference in New Issue
Block a user