Envision
A visual programming IDE for object-oriented languages
|
This is the core manager of the CppImport plugin. More...
Public Member Functions | |
~CppImportManager () | |
Model::TreeManager * | createTreeManager (const bool statisticsPerProject=false) |
Creates a clang tool and translates the sourcecode to Envision's AST and returns the root Be sure to have set the sourcePath before calling this method Set statisticsPerProject if you want statistics output for each subproject. More... | |
void | setImportPaths (QStringList sourcePaths, const bool subProjects=false) |
Use this function to set sourcePath which you want to import. More... | |
void | setupTest () |
Imports code from a test.cpp file in a subdirectory of ENVISION_ROOT/CppImport/test Specify the directory in the testSelector file. More... | |
Static Public Member Functions | |
static int & | processedTranslationUnits () |
The amount of translation units that were imported so far. More... | |
static int & | totalTranslationUnits () |
The amount of translation units to be imported in total. More... | |
Private Member Functions | |
void | createCompilationDbForTest (const QString &testPath) |
Creates a compile_commands file inside testPath Use this method only for simple test.cpp files. More... | |
clang::tooling::CompilationDatabase * | findCompilationDatabase (const QString &path) |
void | initPath (const QString &sourcePath) |
Prepares everything for the project in sourcePath to get imported. More... | |
QString | mainProjectPath (const QString &path) |
Calculates the shortest subpath of subProjectPath containing a CMakeLists.txt file. More... | |
void | readInFiles (const QString &sourcePath) |
Collects all source files in sourcPath and sub directories and stores them in the sourcesMap_. More... | |
void | setCompilationDbPath (const QString &sourcePath) |
Adds the compilation database to compilationDbMap_. More... | |
Private Attributes | |
clang::tooling::CompilationDatabase * | compilationDb_ |
QStringList | cppFilter_ = {"*.cpp", "*.cc", "*.cxx"} |
QString | projectPath_ |
the path to the main CMakeLists.txt of the project to import. More... | |
QStringList | projects_ |
QHash< QString, std::vector< std::string > * > | sourcesMap_ |
This is the core manager of the CppImport plugin.
To import C++ code you have to specify a path to import with the setImportPath method. After having set the source path you can translate the code with the createTreeManager method.
To experiment/test you may want to use the setupTest method.
CppImport::CppImportManager::~CppImportManager | ( | ) |
|
private |
Creates a compile_commands file inside testPath Use this method only for simple test.cpp files.
Model::TreeManager * CppImport::CppImportManager::createTreeManager | ( | const bool | statisticsPerProject = false | ) |
Creates a clang tool and translates the sourcecode to Envision's AST and returns the root Be sure to have set the sourcePath before calling this method Set statisticsPerProject if you want statistics output for each subproject.
|
private |
|
private |
Prepares everything for the project in sourcePath to get imported.
|
private |
Calculates the shortest subpath of subProjectPath containing a CMakeLists.txt file.
|
static |
The amount of translation units that were imported so far.
Used to display import progress.
|
private |
Collects all source files in sourcPath and sub directories and stores them in the sourcesMap_.
|
private |
Adds the compilation database to compilationDbMap_.
void CppImport::CppImportManager::setImportPaths | ( | QStringList | sourcePaths, |
const bool | subProjects = false |
||
) |
Use this function to set sourcePath which you want to import.
If the project has subproject please specify this with setting subProject to true All subprojects that contain a compile_commands file will be translated
void CppImport::CppImportManager::setupTest | ( | ) |
Imports code from a test.cpp file in a subdirectory of ENVISION_ROOT/CppImport/test Specify the directory in the testSelector file.
For simple tests inside the test directory you do not have to provide a compile_commands file
|
static |
The amount of translation units to be imported in total.
Used to display import progress.
|
private |
|
private |
|
private |
the path to the main CMakeLists.txt of the project to import.
|
private |
|
private |