API Documentation
Loading...
Searching...
No Matches
ModuleResourceManager.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/Buffer.h>
4#include <NDEVR/String.h>
5#include <NDEVR/TranslatedString.h>
6#undef linux
7namespace NDEVR
8{
9 /**--------------------------------------------------------------------------------------------------
10 \brief Stores String variables reprenting the type of OS that will be supported by a particular
11 module or resource
12 **/
14 {
17 static String macx;
18 static String ios;
19 static String wasm;
20 static String all;
21 };
22
23 /**--------------------------------------------------------------------------------------------------
24 \brief Stores String variables reprenting the type of compile configuration that will be supported
25 by a particular Module or resource (debug vs release)
26 **/
28 {
29 static String debug;
31 static String all;
32 };
33
34 /**--------------------------------------------------------------------------------------------------
35 \brief Stores String variables reprenting the type of platform CPU configuration that will be supported
36 by a particular Module or resource (x64, x86, arm etc)
37 **/
39 {
40 static String x86;
41 static String x64;
43 static String arm64;
44 static String all;
45 };
46
47 /**--------------------------------------------------------------------------------------------------
48 \brief Stores the type of dependency for a Module or resource.
49 **/
62
63 /**--------------------------------------------------------------------------------------------------
64 \brief Stores all information relating to a particular feature or resource included by a Module.
65 **/
67 {
69 : os_type(OSType::all)
70 , config_type(ConfigType::all)
71 , platform_type(PlatformType::all)
72 {}
73 ModuleConfiguration(const String& os_type, const String& config_type, const String& platform_type)
74 : os_type(os_type)
75 , config_type(config_type)
76 , platform_type(platform_type)
77 {}
78
79 bool neededForOS(const String& os) const
80 {
81 return os_type.hasSubString(os);
82 }
83 bool neededForConfig(const String& os) const
84 {
85 return config_type.hasSubString(os);
86 }
87 bool neededForPlatform(const String& os) const
88 {
89 return platform_type.hasSubString(os);
90 }
91 static String Combine(std::initializer_list<String> l);
92 static String& Remove(String& s, std::initializer_list<String> l);
96 };
97
98 /**--------------------------------------------------------------------------------------------------
99 \brief describes the Module or feature to the end user.
100 **/
102 {
105 TranslatedString description;//Description for this firewall rule displayed in Windows Firewall manager in Windows Vista and later.
106 };
107
108 /**--------------------------------------------------------------------------------------------------
109 \brief Stores information relating to a particular FireWallException needed by a Module or feature
110 **/
112 {
114 String protocol = "tcp";//tcp or udp
115 String profile = "domain";//domain,private,public, or all
116 String scope = "any";//any or localSubnet
117 uint04 port = Constant<uint04>::Invalid;//Port to allow through the firewall for this exception.
118 bool ignore_failure = true;//If true failures to register this firewall exception will be silently ignored. If false, failures will cause rollback.
119 };
120
121 /**--------------------------------------------------------------------------------------------------
122 \brief Stores variables needed to perform a file action for a particular Module or resource
123 **/
125 {
126 String id;//ndv_open
127 String command = "Open";
128 String argument = "--open &quot;%1&quot;";
129 };
130
131 /**--------------------------------------------------------------------------------------------------
132 \brief A description of the type of file a Module or resource can handle
133 **/
140
141 /**--------------------------------------------------------------------------------------------------
142 \brief Stores information relating to a type of file the module can preview or handle
143 **/
150
151 /**--------------------------------------------------------------------------------------------------
152 \brief Available registry actions that can be taken on program installation.
153 **/
155 {
156 e_append //Appends the specified value(s) to a multiString registry key.
157 , e_create //Creates the key, if absent, when the parent component is installed.
158 , e_remove//Removes a registry name when the parent component is installed.
159 };
160
161 /**--------------------------------------------------------------------------------------------------
162 \brief Available registry actions that can be taken on program installation.
163 **/
164 enum class RegistryType
165 {
166 e_string //The value is interpreted and stored as a string(REG_SZ).
167 , e_integer //The value is interpreted and stored as an integer(REG_DWORD).
168 , e_binary //The value is interpreted and stored as a hexadecimal value(REG_BINARY).
169 , e_expandable //The value is interpreted and stored as an expandable string(REG_EXPAND_SZ).
171 , e_folder
172 };
173 /**--------------------------------------------------------------------------------------------------
174 \brief Information about a requested OS-permission typically requested at install time.
175 **/
177 {
180 bool append = false;
181 bool change_permission = false;
182 bool create_child = false;
183 bool create_file = false;
184 bool create_link = false;
185 bool create_subkey = false;
186 bool delete_object = false;
187 bool delete_child = false;
188 bool enumerate_subkey = false;
189 bool execute = false;
190 bool read = true;
191 bool notify = false;
192 bool take_ownership = false;
193 bool write = false;
194 bool all_rights = false;
195 };
196
197 /**--------------------------------------------------------------------------------------------------
198 \brief Information about a specific registry action to be taken, typically at install-time
199 **/
211
212 /**--------------------------------------------------------------------------------------------------
213 \brief A dependency of a Module. Either a resource, or install action, defined by the module and
214 automatically handled by the NDEVR build environment
215 **/
217 {
218 ModuleDependency(DependecyType type, const String& resource, const String& os_type, const String& config_type, const String& platform_type = PlatformType::all)
219 : ModuleConfiguration(os_type, config_type, platform_type)
220 , resource(resource)
221 , type(type)
222 {}
223 ModuleDependency(const String& resource, const String& os_type, const String& config_type, const String& platform_type = PlatformType::all)
224 : ModuleConfiguration(os_type, config_type, platform_type)
225 , resource(resource)
226 , type(DependecyType::e_library)
227 {}
228 ModuleDependency(const FireWallException& exception, const String& os_type, const String& config_type, const String& platform_type = PlatformType::all);
229
233 DependecyType type = DependecyType::e_library;
234 };
235 /**--------------------------------------------------------------------------------------------------
236 \brief Stores all dependencies for a combination of modules that make up a complete software package
237 **/
249}
#define NDEVR_BASE_API
Definition DLLInfo.h:57
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Stores all dependencies for a combination of modules that make up a complete software package.
Definition ModuleResourceManager.h:239
String launch_function
Definition ModuleResourceManager.h:247
Buffer< FireWallException > firewall_exceptions
Definition ModuleResourceManager.h:242
Buffer< FileHandler > file_handlers
Definition ModuleResourceManager.h:244
Buffer< String > permissions
Definition ModuleResourceManager.h:243
Buffer< ModuleDependency > dependencies
Definition ModuleResourceManager.h:241
Buffer< RegistryKeyAction > registry_actions
Definition ModuleResourceManager.h:245
ModuleConfiguration supported_configurations
Definition ModuleResourceManager.h:246
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
Definition ACIColor.h:37
RegistryActionType
Available registry actions that can be taken on program installation.
Definition ModuleResourceManager.h:155
DependecyType
Stores the type of dependency for a Module or resource.
Definition ModuleResourceManager.h:51
@ e_source_folder
Definition ModuleResourceManager.h:60
@ e_module
Definition ModuleResourceManager.h:55
@ e_type
Definition ModuleResourceManager.h:56
@ e_library
Definition ModuleResourceManager.h:53
@ e_rcc_resource
Definition ModuleResourceManager.h:59
@ e_bundled_folder
Definition ModuleResourceManager.h:58
@ e_executable
Definition ModuleResourceManager.h:54
@ e_file
Definition ModuleResourceManager.h:52
@ e_firewall_exception
Definition ModuleResourceManager.h:57
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
RegistryType
Available registry actions that can be taken on program installation.
Definition ModuleResourceManager.h:165
Stores String variables reprenting the type of compile configuration that will be supported by a part...
Definition ModuleResourceManager.h:28
static String release
Definition ModuleResourceManager.h:30
static String all
Definition ModuleResourceManager.h:31
static String debug
Definition ModuleResourceManager.h:29
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
A description of the type of file a Module or resource can handle.
Definition ModuleResourceManager.h:135
String id
Definition ModuleResourceManager.h:136
String content_type
Definition ModuleResourceManager.h:137
Buffer< FileHandlerVerb > verbs
Definition ModuleResourceManager.h:138
Stores information relating to a type of file the module can preview or handle.
Definition ModuleResourceManager.h:145
String icon
Definition ModuleResourceManager.h:146
bool advertise
Definition ModuleResourceManager.h:147
Buffer< FileHanderExtension > extensions
Definition ModuleResourceManager.h:148
Stores variables needed to perform a file action for a particular Module or resource.
Definition ModuleResourceManager.h:125
String argument
Definition ModuleResourceManager.h:128
String id
Definition ModuleResourceManager.h:126
String command
Definition ModuleResourceManager.h:127
Stores information relating to a particular FireWallException needed by a Module or feature.
Definition ModuleResourceManager.h:112
String protocol
Definition ModuleResourceManager.h:114
String profile
Definition ModuleResourceManager.h:115
String scope
Definition ModuleResourceManager.h:116
bool ignore_failure
Definition ModuleResourceManager.h:118
uint04 port
Definition ModuleResourceManager.h:117
Buffer< String > remote_addresses
Definition ModuleResourceManager.h:113
Stores all information relating to a particular feature or resource included by a Module.
Definition ModuleResourceManager.h:67
bool neededForConfig(const String &os) const
Definition ModuleResourceManager.h:83
ModuleConfiguration(const String &os_type, const String &config_type, const String &platform_type)
Definition ModuleResourceManager.h:73
bool neededForOS(const String &os) const
Definition ModuleResourceManager.h:79
String config_type
Definition ModuleResourceManager.h:94
String os_type
Definition ModuleResourceManager.h:93
static String Combine(std::initializer_list< String > l)
String platform_type
Definition ModuleResourceManager.h:95
bool neededForPlatform(const String &os) const
Definition ModuleResourceManager.h:87
static String & Remove(String &s, std::initializer_list< String > l)
ModuleConfiguration()
Definition ModuleResourceManager.h:68
A dependency of a Module. Either a resource, or install action, defined by the module and automatical...
Definition ModuleResourceManager.h:217
ModuleDependency(const String &resource, const String &os_type, const String &config_type, const String &platform_type=PlatformType::all)
Definition ModuleResourceManager.h:223
String os_type
Definition ModuleResourceManager.h:232
FireWallException getAsFirewallException() const
ModuleDependency(DependecyType type, const String &resource, const String &os_type, const String &config_type, const String &platform_type=PlatformType::all)
Definition ModuleResourceManager.h:218
String resource
Definition ModuleResourceManager.h:231
ModuleDependency(const FireWallException &exception, const String &os_type, const String &config_type, const String &platform_type=PlatformType::all)
describes the Module or feature to the end user.
Definition ModuleResourceManager.h:102
TranslatedString description
Definition ModuleResourceManager.h:105
TranslatedString name
Definition ModuleResourceManager.h:104
String id
Definition ModuleResourceManager.h:103
Stores String variables reprenting the type of OS that will be supported by a particular module or re...
Definition ModuleResourceManager.h:14
static String all
Definition ModuleResourceManager.h:20
static String wasm
Definition ModuleResourceManager.h:19
static String ios
Definition ModuleResourceManager.h:18
static String android
Definition ModuleResourceManager.h:16
static String macx
Definition ModuleResourceManager.h:17
static String windows
Definition ModuleResourceManager.h:15
Information about a requested OS-permission typically requested at install time.
Definition ModuleResourceManager.h:177
bool all_rights
Definition ModuleResourceManager.h:194
bool execute
Definition ModuleResourceManager.h:189
bool create_file
Definition ModuleResourceManager.h:183
bool create_child
Definition ModuleResourceManager.h:182
bool notify
Definition ModuleResourceManager.h:191
String domain
Definition ModuleResourceManager.h:178
bool enumerate_subkey
Definition ModuleResourceManager.h:188
bool change_permission
Definition ModuleResourceManager.h:181
bool create_subkey
Definition ModuleResourceManager.h:185
bool write
Definition ModuleResourceManager.h:193
String user
Definition ModuleResourceManager.h:179
bool delete_object
Definition ModuleResourceManager.h:186
bool append
Definition ModuleResourceManager.h:180
bool delete_child
Definition ModuleResourceManager.h:187
bool take_ownership
Definition ModuleResourceManager.h:192
bool read
Definition ModuleResourceManager.h:190
bool create_link
Definition ModuleResourceManager.h:184
Stores String variables reprenting the type of platform CPU configuration that will be supported by a...
Definition ModuleResourceManager.h:39
static String all
Definition ModuleResourceManager.h:44
static String x86
Definition ModuleResourceManager.h:40
static String arm64
Definition ModuleResourceManager.h:43
static String x64
Definition ModuleResourceManager.h:41
static String armeabi
Definition ModuleResourceManager.h:42
Information about a specific registry action to be taken, typically at install-time.
Definition ModuleResourceManager.h:201
RegistryActionType action
Definition ModuleResourceManager.h:206
String root
Definition ModuleResourceManager.h:202
String value
Definition ModuleResourceManager.h:204
bool ownership
Definition ModuleResourceManager.h:208
Buffer< Permission > permissions
Definition ModuleResourceManager.h:207
bool is_key_path
Definition ModuleResourceManager.h:209
RegistryType type
Definition ModuleResourceManager.h:205
String path
Definition ModuleResourceManager.h:203