logic: improved include detection

* also search for include paths of include directives extracted from header search paths
* extracted logic to gather unsolved includes
* extracted some code to filetree class
This commit is contained in:
mlangkabel
2018-01-23 21:35:53 +01:00
parent 56cac267a2
commit 7c863ddf00
13 changed files with 269 additions and 148 deletions
+25
View File
@@ -0,0 +1,25 @@
#ifndef FILE_TREE_H
#define FILE_TREE_H
#include <string>
#include <set>
#include <unordered_map>
#include "utility/file/FilePath.h"
class FileTree
{
public:
FileTree(const FilePath& rootPath);
FilePath getAbsoluteRootPathForRelativeFilePath(const FilePath& relativeFilePath);
std::vector<FilePath> getAbsoluteRootPathsForRelativeFilePath(const FilePath& relativeFilePath);
private:
std::vector<FilePath> doGetAbsoluteRootPathsForRelativeFilePath(const FilePath& relativeFilePath, bool allowMultipleResults);
FilePath m_rootPath;
std::unordered_map<std::string, std::set<FilePath>> m_files;
};
#endif // FILE_TREE_H