aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-04-22 16:28:08 +0200
committerGitHub Enterprise <[email protected]>2025-04-22 16:28:08 +0200
commit732a1cb1e78abbabaa0d926e9b1e58a36538dc1b (patch)
tree08d47d333f68e2f99ec7ec922fa72dea4ee96dbc /src/zenutil/include
parentxmake updatefrontend (diff)
downloadzen-732a1cb1e78abbabaa0d926e9b1e58a36538dc1b.tar.xz
zen-732a1cb1e78abbabaa0d926e9b1e58a36538dc1b.zip
add cxxopts overload for parsing file paths from command line (#362)
Diffstat (limited to 'src/zenutil/include')
-rw-r--r--src/zenutil/include/zenutil/commandlineoptions.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/zenutil/include/zenutil/commandlineoptions.h b/src/zenutil/include/zenutil/commandlineoptions.h
new file mode 100644
index 000000000..3afbac854
--- /dev/null
+++ b/src/zenutil/include/zenutil/commandlineoptions.h
@@ -0,0 +1,28 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#pragma once
+
+#include <zencore/zencore.h>
+#include <filesystem>
+
+ZEN_THIRD_PARTY_INCLUDES_START
+
+namespace cxxopts::values {
+// We declare this specialization before including cxxopts to make it stick
+void parse_value(const std::string& text, std::filesystem::path& value);
+} // namespace cxxopts::values
+
+#include <cxxopts.hpp>
+ZEN_THIRD_PARTY_INCLUDES_END
+
+namespace zen {
+
+std::vector<std::string> ParseCommandLine(std::string_view CommandLine);
+std::vector<char*> StripCommandlineQuotes(std::vector<std::string>& InOutArgs);
+void MakeSafeAbsolutePathÍnPlace(std::filesystem::path& Path);
+std::filesystem::path MakeSafeAbsolutePath(const std::filesystem::path& Path);
+std::filesystem::path StringToPath(const std::string_view& Path);
+
+void commandlineoptions_forcelink(); // internal
+
+} // namespace zen