forked from Open-CMSIS-Pack/devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjMgrExtGenerator.h
More file actions
121 lines (101 loc) · 3.15 KB
/
Copy pathProjMgrExtGenerator.h
File metadata and controls
121 lines (101 loc) · 3.15 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
/*
* Copyright (c) 2020-2023 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef PROJMGREXTGENERATOR_H
#define PROJMGREXTGENERATOR_H
#include "ProjMgrParser.h"
#include "ProjMgrUtils.h"
/**
* @brief map of used generators options
*/
typedef std::map<GeneratorOptionsItem, StrVec> GeneratorContextVecMap;
/**
* @brief solution/project types
*/
static constexpr const char* TYPE_SINGLE_CORE = "single-core";
static constexpr const char* TYPE_MULTI_CORE = "multi-core";
static constexpr const char* TYPE_TRUSTZONE = "trustzone";
/**
* @brief projmgr external generator class responsible for handling global generators
*/
class ProjMgrExtGenerator {
public:
/**
* @brief class constructor
*/
ProjMgrExtGenerator(ProjMgrParser* parser);
/**
* @brief class destructor
*/
~ProjMgrExtGenerator();
/**
* @brief set check schema
* @param boolean check schema
*/
void SetCheckSchema(bool checkSchema);
/**
* @brief verify if generator is global
* @param generatorId generator identifier
* @return true if generator is global
*/
bool IsGlobalGenerator(const std::string& generatorId);
/**
* @brief verify if generator required by a given component is valid
* @param generatorId generator identifier
* @param componentId component identifier
* @return true if generator is valid
*/
bool CheckGeneratorId(const std::string& generatorId, const std::string& componentId);
/**
* @brief get directory for generated files
* @param generatorId generator identifier
* @return string directory for generated files
*/
const std::string& GetGlobalGenDir(const std::string& generatorId);
/**
* @brief get run command for generator call
* @param generatorId generator identifier
* @return string with run command for generator call
*/
const std::string& GetGlobalGenRunCmd(const std::string& generatorId);
/**
* @brief get URL for generator download
* @param generatorId generator identifier
* @return string with URL for generator download
*/
const std::string& GetGlobalGenUrl(const std::string& generatorId);
/**
* @brief get generator description
* @param generatorId generator identifier
* @return string with generator description
*/
const std::string& GetGlobalDescription(const std::string& generatorId);
/**
* @brief add generator to the list of used generators of a given context
* @param generator options
* @param contextId context identifier
*/
void AddUsedGenerator(const GeneratorOptionsItem& options, const std::string& contextId);
/**
* @brief get map of used generators
* @return map of used generators
*/
const GeneratorContextVecMap& GetUsedGenerators(void);
/**
* @brief get layer item with generator-import file data
* @param contextId context identifier
* @param boolean reference, true if successful
* @return layer item
*/
ClayerItem* GetGeneratorImport(const std::string& contextId, bool& success);
void Clear() {
m_usedGenerators.clear();
}
protected:
ProjMgrParser* m_parser = nullptr;
GeneratorContextVecMap m_usedGenerators;
bool m_checkSchema;
};
#endif // PROJMGREXTGENERATOR_H