diff options
| author | Dan Engelbrecht <[email protected]> | 2025-06-10 13:08:59 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2025-06-10 13:08:59 +0200 |
| commit | f696e52d150ae284e26de5bdd78d1b1edf914314 (patch) | |
| tree | 392920b1a1334d61900b871b851228cd7963a46c /src/zenutil/environmentoptions.cpp | |
| parent | add sentry configurations options for debug/environment (diff) | |
| download | zen-f696e52d150ae284e26de5bdd78d1b1edf914314.tar.xz zen-f696e52d150ae284e26de5bdd78d1b1edf914314.zip | |
revert 61b4a88f and cadaad63
Diffstat (limited to 'src/zenutil/environmentoptions.cpp')
| -rw-r--r-- | src/zenutil/environmentoptions.cpp | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/src/zenutil/environmentoptions.cpp b/src/zenutil/environmentoptions.cpp deleted file mode 100644 index fc37b63c6..000000000 --- a/src/zenutil/environmentoptions.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#include <zenutil/environmentoptions.h> - -#include <zencore/filesystem.h> - -namespace zen { - -EnvironmentOptions::StringOption::StringOption(std::string& Value) : RefValue(Value) -{ -} -void -EnvironmentOptions::StringOption::Parse(std::string_view Value) -{ - RefValue = std::string(Value); -} - -EnvironmentOptions::FilePathOption::FilePathOption(std::filesystem::path& Value) : RefValue(Value) -{ -} -void -EnvironmentOptions::FilePathOption::Parse(std::string_view Value) -{ - RefValue = MakeSafeAbsolutePath(Value); -} - -EnvironmentOptions::BoolOption::BoolOption(bool& Value) : RefValue(Value) -{ -} -void -EnvironmentOptions::BoolOption::Parse(std::string_view Value) -{ - const std::string Lower = ToLower(Value); - if (Lower == "true" || Lower == "y" || Lower == "yes") - { - RefValue = true; - } - else if (Lower == "false" || Lower == "n" || Lower == "no") - { - RefValue = false; - } -} - -std::shared_ptr<EnvironmentOptions::OptionValue> -EnvironmentOptions::MakeOption(std::string& Value) -{ - return std::make_shared<StringOption>(Value); -} - -std::shared_ptr<EnvironmentOptions::OptionValue> -EnvironmentOptions::MakeOption(std::filesystem::path& Value) -{ - return std::make_shared<FilePathOption>(Value); -} - -std::shared_ptr<EnvironmentOptions::OptionValue> -EnvironmentOptions::MakeOption(bool& Value) -{ - return std::make_shared<BoolOption>(Value); -} - -EnvironmentOptions::EnvironmentOptions() -{ -} - -void -EnvironmentOptions::Parse(const cxxopts::ParseResult& CmdLineResult) -{ - for (auto& It : OptionMap) - { - std::string_view EnvName = It.first; - const Option& Opt = It.second; - if (CmdLineResult.count(Opt.CommandLineOptionName) == 0) - { - std::string EnvValue = GetEnvVariable(It.first); - if (EnvValue.empty()) - { - Opt.Value->Parse(EnvValue); - } - } - } -} - -} // namespace zen |