MCPcopy Create free account
hub / github.com/COVESA/vsomeip / load

Method load

implementation/configuration/src/configuration_impl.cpp:197–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195configuration_impl::~configuration_impl() { }
196
197bool configuration_impl::load(const std::string& _name) {
198 std::scoped_lock its_lock(mutex_);
199 if (is_loaded_)
200 return true;
201
202 // Environment
203 char* its_env;
204
205 // Predefine file / folder
206 std::string its_file(VSOMEIP_DEFAULT_CONFIGURATION_FILE); // configuration file
207 std::string its_folder(VSOMEIP_DEFAULT_CONFIGURATION_FOLDER); // configuration folder
208
209 if (!path_.empty()) {
210 if (utility::is_file(path_)) {
211 its_file = path_;
212 its_folder = "";
213 } else {
214 its_file = "";
215 its_folder = path_;
216 }
217 }
218
219 // Override with local file / folder (if existing)
220 std::string its_local_file(VSOMEIP_LOCAL_CONFIGURATION_FILE);
221 if (utility::is_file(its_local_file)) {
222 its_file = its_local_file;
223 }
224
225 std::string its_local_folder(VSOMEIP_LOCAL_CONFIGURATION_FOLDER);
226 if (utility::is_folder(its_local_folder)) {
227 its_folder = its_local_folder;
228 }
229
230 // Override with path from environment (if existing)
231 std::string its_named_configuration(VSOMEIP_ENV_CONFIGURATION);
232 its_named_configuration += "_" + _name;
233
234 its_env = VSOMEIP_GETENV(its_named_configuration.c_str());
235 if (nullptr == its_env)
236 its_env = VSOMEIP_GETENV(VSOMEIP_ENV_CONFIGURATION);
237 if (nullptr != its_env) {
238 if (utility::is_file(its_env)) {
239 its_file = its_env;
240 its_folder = "";
241 } else if (utility::is_folder(its_env)) {
242 its_folder = its_env;
243 its_file = "";
244 }
245 }
246
247 std::set<std::string> its_input;
248 if (its_file != "") {
249 its_input.insert(its_file);
250 }
251 if (its_folder != "") {
252 its_input.insert(its_folder);
253#if defined(__linux__) || defined(__QNX__)
254 // load security configuration files from UID_GID sub folder if existing

Callers 4

configuration_implMethod · 0.45
lazy_load_securityMethod · 0.45
load_securityMethod · 0.45
get_configurationMethod · 0.45

Calls 4

read_dataFunction · 0.85
initFunction · 0.85
insertMethod · 0.80
countMethod · 0.80

Tested by

no test coverage detected