aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/environmentoptions.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-02-13 13:47:51 +0100
committerGitHub Enterprise <[email protected]>2026-02-13 13:47:51 +0100
commitb0a3de5fec8f4da8f9513b02bc2326aa6a0e7bd5 (patch)
treea365bcd2bd339fc275d19bdc78ea3af0d2437386 /src/zenutil/environmentoptions.cpp
parentadd IHttpRequestFilter to allow server implementation to filter/reject reques... (diff)
downloadzen-b0a3de5fec8f4da8f9513b02bc2326aa6a0e7bd5.tar.xz
zen-b0a3de5fec8f4da8f9513b02bc2326aa6a0e7bd5.zip
logging config move to zenutil (#754)
made logging config options from zenserver available in zen CLI
Diffstat (limited to 'src/zenutil/environmentoptions.cpp')
-rw-r--r--src/zenutil/environmentoptions.cpp84
1 files changed, 0 insertions, 84 deletions
diff --git a/src/zenutil/environmentoptions.cpp b/src/zenutil/environmentoptions.cpp
deleted file mode 100644
index ee40086c1..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(EnvName);
- if (!EnvValue.empty())
- {
- Opt.Value->Parse(EnvValue);
- }
- }
- }
-}
-
-} // namespace zen