Executed compiler frontend and extract default system paths. More...
Executed compiler frontend and extract default system paths.
This class - inspired by the clangd
language server - will invoke the provided compiler command and query it for its default system paths, which then will be added to each compile command in the database.
Definition at line 33 of file query_driver_output_extractor.h.
#include <query_driver_output_extractor.h>
Public Member Functions | |
query_driver_output_extractor (std::string command, std::string language) | |
Constructor. | |
~query_driver_output_extractor ()=default | |
void | execute () |
Execute the command and extract compiler flags and include paths. | |
void | extract_target (const std::string &output) |
Extract target name from the compiler output. | |
void | extract_system_include_paths (const std::string &output) |
Extract system include paths from the compiler output. | |
const std::string & | target () const |
Name of the target of the compiler command (e.g. x86_64-linux-gnu) | |
const std::vector< std::string > & | system_include_paths () const |
Return list of include system paths. | |
Private Attributes | |
std::string | command_ |
std::string | language_ |
std::string | target_ |
std::vector< std::string > | system_include_paths_ |
clanguml::util::query_driver_output_extractor::query_driver_output_extractor | ( | std::string | command, |
std::string | language | ||
) |
Constructor.
command | Command to execute the compiler frontend |
language | Language name to query for (C or C++) |
Definition at line 29 of file query_driver_output_extractor.cc.
|
default |
void clanguml::util::query_driver_output_extractor::execute | ( | ) |
Execute the command and extract compiler flags and include paths.
Definition at line 36 of file query_driver_output_extractor.cc.
void clanguml::util::query_driver_output_extractor::extract_system_include_paths | ( | const std::string & | output | ) |
Extract system include paths from the compiler output.
output | Compiler query driver output |
Definition at line 74 of file query_driver_output_extractor.cc.
void clanguml::util::query_driver_output_extractor::extract_target | ( | const std::string & | output | ) |
Extract target name from the compiler output.
output | Compiler query driver output |
Definition at line 60 of file query_driver_output_extractor.cc.
const std::vector< std::string > & clanguml::util::query_driver_output_extractor::system_include_paths | ( | ) | const |
Return list of include system paths.
Definition at line 98 of file query_driver_output_extractor.cc.
const std::string & clanguml::util::query_driver_output_extractor::target | ( | ) | const |
Name of the target of the compiler command (e.g. x86_64-linux-gnu)
Definition at line 103 of file query_driver_output_extractor.cc.
|
private |
Definition at line 79 of file query_driver_output_extractor.h.
|
private |
Definition at line 80 of file query_driver_output_extractor.h.
|
private |
Definition at line 82 of file query_driver_output_extractor.h.
|
private |
Definition at line 81 of file query_driver_output_extractor.h.