-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmi_analyzer_impl.hpp
More file actions
113 lines (86 loc) · 2.52 KB
/
mi_analyzer_impl.hpp
File metadata and controls
113 lines (86 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#pragma once
#include "model_includes/api/mi_analyzer.hpp"
//------------------------------------------------------------------------------
namespace fs {
class FileSystem;
}
//------------------------------------------------------------------------------
namespace parser {
class Parser;
class IncludeFile;
}
//------------------------------------------------------------------------------
namespace model_includes {
class Model;
class File;
enum class FileType;
enum class IncludeType;
enum class IncludeStatus;
//------------------------------------------------------------------------------
class AnalyzerImpl final : public Analyzer
{
public:
AnalyzerImpl(
const fs::FileSystem & _fs,
const parser::Parser & _parser
);
ModelPtr analyze( const Project & _project ) const override;
private:
using IncludeFiles = stdfwd::vector< parser::IncludeFile >;
using IgnoredFiles = stdfwd::unordered_set< std::filesystem::path >;
void analyzeFolder(
const Project & _project,
const std::filesystem::path & _path,
Model & _model,
IgnoredFiles & _ignoreFiles
) const;
void analyzeFile(
const Project & _project,
const std::filesystem::path & _path,
Model & _model,
IgnoredFiles & _ignoreFiles
) const;
void analyzeIncludeFiles(
const Project & _project,
const std::filesystem::path & _path,
const IncludeFiles & _includesFile,
Model & _model,
IgnoredFiles & _ignoreFiles
) const;
void analyzeIncludeFile(
const Project & _project,
const std::filesystem::path & _path,
const parser::IncludeFile & _includesFile,
File & _file,
Model & _model,
IgnoredFiles & _ignoreFiles
) const;
bool isCppFile(
const Project & _project,
const std::filesystem::path & _path
) const;
const std::filesystem::path & getProjectDir() const;
using ResolvedPath = std::pair< std::filesystem::path, bool >;
ResolvedPath resolvePath(
const Project & _project,
const std::filesystem::path & _currentFile,
const parser::IncludeFile & _includeFile
) const;
FileType getFileType( const std::filesystem::path & _path ) const;
IncludeType getIncludeType( const parser::IncludeFile & _includesFile ) const;
IncludeStatus getIncludeStatus(
const File & _file,
const ResolvedPath & _pair
) const;
static bool isIgnoredFile(
const std::filesystem::path & _path,
const Project & _project,
const Model & _model,
IgnoredFiles & _ignoreFiles
);
private:
const fs::FileSystem & m_fs;
const parser::Parser & m_parser;
};
//------------------------------------------------------------------------------
}