make update message adjustable by provider

This commit is contained in:
Lion Kortlepel
2023-12-29 01:10:24 +01:00
committed by Lion
parent b0f5976121
commit c6aa7776fc
4 changed files with 45 additions and 2 deletions

20
src/Env.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include "Env.h"
#include <optional>
std::optional<std::string> Env::Get(Env::Key key) {
auto StrKey = ToString(key);
auto Value = std::getenv(StrKey.data());
if (!Value || std::string_view(Value).empty()) {
return std::nullopt;
}
return Value;
}
std::string_view Env::ToString(Env::Key key) {
switch (key) {
case Key::PROVIDER_UPDATE_MESSAGE:
return "BEAMMP_PROVIDER_UPDATE_MESSAGE";
break;
}
return "";
}