Reorganization directory structure [3/n]

Change-Id: If3dfa3f6007f8810a6a1ae1a4f0c7da38544648d
This commit is contained in:
kamdiedrich
2020-02-23 21:00:51 +01:00
committed by sys_ocldev
parent e177b4fc0f
commit e072275ae6
711 changed files with 94 additions and 94 deletions

View File

@@ -0,0 +1,46 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "os_interface/linux/debug_env_reader.h"
namespace NEO {
SettingsReader *SettingsReader::createOsReader(bool userScope, const std::string &regKey) {
return new EnvironmentVariableReader;
}
const char *EnvironmentVariableReader::appSpecificLocation(const std::string &name) {
return name.c_str();
}
bool EnvironmentVariableReader::getSetting(const char *settingName, bool defaultValue) {
return getSetting(settingName, static_cast<int32_t>(defaultValue)) ? true : false;
}
int32_t EnvironmentVariableReader::getSetting(const char *settingName, int32_t defaultValue) {
int32_t value = defaultValue;
char *envValue;
envValue = getenv(settingName);
if (envValue) {
value = atoi(envValue);
}
return value;
}
std::string EnvironmentVariableReader::getSetting(const char *settingName, const std::string &value) {
char *envValue;
std::string keyValue;
keyValue.assign(value);
envValue = getenv(settingName);
if (envValue) {
keyValue.assign(envValue);
}
return keyValue;
}
} // namespace NEO