-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathapp_con.hpp
More file actions
171 lines (127 loc) · 3.91 KB
/
app_con.hpp
File metadata and controls
171 lines (127 loc) · 3.91 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#pragma once
#include "application/tools/app_plugin_ptr.hpp"
#include <stdfwd/memory>
#include <stdfwd/vector>
//------------------------------------------------------------------------------
namespace fs
{
class FileSystem;
class FileSystemAccessor;
}
namespace parser
{
class ParserAccessor;
class Parser;
}
namespace model_includes
{
class Model;
class Analyzer;
class ModelIncludesAccessor;
}
namespace project
{
class ProjectAccessor;
class Project;
}
namespace cmake_project
{
class Project;
class Accessor;
}
namespace compilation_db
{
class Accessor;
}
namespace reporter
{
class ReporterAccessor;
class Reporter;
class Settings;
class Factory;
enum class ReporterKind;
}
namespace json
{
class JsonAccessor;
}
//------------------------------------------------------------------------------
namespace application
{
class ParserArgWrapper;
class ConfigurationFile;
class Log;
//------------------------------------------------------------------------------
class ConcoleApplication
{
public:
ConcoleApplication();
~ConcoleApplication();
int run( int _argc, char * _argv[] );
private:
using ProjectAccessor = project::ProjectAccessor;
using Project = project::Project;
using ProjectPtr = std::unique_ptr< Project >;
using CMakeProject = cmake_project::Project;
using CMakeProjectPtr = std::unique_ptr< CMakeProject >;
using CMakeAccessor = cmake_project::Accessor;
using ModelIncludesAccessor = model_includes::ModelIncludesAccessor;
using Model = model_includes::Model;
using ModelPtr = std::unique_ptr< Model >;
using Analyzer = model_includes::Analyzer;
using AnalyzerPtr = std::unique_ptr< model_includes::Analyzer >;
using ParserAccessor = parser::ParserAccessor;
using Parser = parser::Parser;
using ParserPtr = std::unique_ptr< parser::Parser >;
using ReporterAccessor = reporter::ReporterAccessor;
using Report = reporter::Reporter;
using ReportPtr = std::unique_ptr< Report >;
using ReporterKinds = stdfwd::vector< reporter::ReporterKind >;
using JsonAccessor = json::JsonAccessor;
using CompilationDbAccessor = compilation_db::Accessor;
using ConfigurationFilePtr = std::unique_ptr< ConfigurationFile >;
ModelPtr
runAnalyzer( const Project & _project, const CMakeProject * _cmakeProject );
void runReporters(
const Model & _model,
const ReporterKinds & _kinds,
const reporter::Settings & _reporterSettings );
ProjectPtr createProject(
const ParserArgWrapper & _arguments,
const ConfigurationFile * _configurationFile );
CMakeProjectPtr createCMakeProject(
const ParserArgWrapper & _arguments,
const ConfigurationFile * _configurationFile );
ConfigurationFilePtr
loadConfigurationFile( const ParserArgWrapper & _arguments );
ProjectAccessor & ensureProjectAccessor();
ModelIncludesAccessor & ensureModelIncludesAccessor();
AnalyzerPtr createAnalyzer();
fs::FileSystemAccessor & ensureFileSystemAccessor();
fs::FileSystem & ensureFileSystem();
ParserAccessor & ensureParserAccessor();
const Parser & ensureParser();
ReporterAccessor & ensureReporterAccessor();
reporter::Factory & getReporterFactory();
JsonAccessor & ensureJsonAccessor();
CMakeAccessor & ensureCMakeAccessor();
CompilationDbAccessor & ensureCompilationDbAccessor();
Log & getLog();
void dump( const Project & _project ) const;
void dump( const CMakeProject & _project ) const;
void showVersion();
static void setSystemSeparators( char _seperator );
private:
PluginPtr< ProjectAccessor > m_projectAccessor;
PluginPtr< ModelIncludesAccessor > m_modelIncludesAccessor;
PluginPtr< fs::FileSystemAccessor > m_fileSystemAccessor;
PluginPtr< ParserAccessor > m_parserAccessor;
PluginPtr< ReporterAccessor > m_reporterAccessor;
PluginPtr< JsonAccessor > m_jsonAccessor;
PluginPtr< CMakeAccessor > m_cmakeAccessor;
PluginPtr< CompilationDbAccessor > m_compilationDbAccessor;
ParserPtr m_parser;
std::unique_ptr< Log > m_log;
};
//------------------------------------------------------------------------------
}