aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/vcpkg_System.h
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/include/vcpkg_System.h')
-rw-r--r--toolsrc/include/vcpkg_System.h30
1 files changed, 19 insertions, 11 deletions
diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h
index 1101c9b27..71caeed5e 100644
--- a/toolsrc/include/vcpkg_System.h
+++ b/toolsrc/include/vcpkg_System.h
@@ -1,10 +1,14 @@
#pragma once
+#include <Windows.h>
#include "vcpkg_Strings.h"
#include "filesystem_fs.h"
+#include "vcpkg_optional.h"
-namespace vcpkg {namespace System
+namespace vcpkg::System
{
+ optional<std::wstring> get_registry_string(HKEY base, const wchar_t* subkey, const wchar_t* valuename);
+
fs::path get_exe_path_of_current_process();
struct exit_code_and_output
@@ -13,6 +17,13 @@ namespace vcpkg {namespace System
std::string output;
};
+ int cmd_execute_clean(const wchar_t* cmd_line);
+
+ inline int cmd_execute_clean(const std::wstring& cmd_line)
+ {
+ return cmd_execute_clean(cmd_line.c_str());
+ }
+
int cmd_execute(const wchar_t* cmd_line);
inline int cmd_execute(const std::wstring& cmd_line)
@@ -27,6 +38,10 @@ namespace vcpkg {namespace System
return cmd_execute_and_capture_output(cmd_line.c_str());
}
+ std::wstring create_powershell_script_cmd(const fs::path& script_path);
+
+ std::wstring create_powershell_script_cmd(const fs::path& script_path, const std::wstring& args);
+
enum class color
{
success = 10,
@@ -83,14 +98,7 @@ namespace vcpkg {namespace System
return println(c, Strings::format(messageTemplate, messageArgs...).c_str());
}
- struct Stopwatch2
- {
- int64_t start_time, end_time, freq;
-
- void start();
- void stop();
- double microseconds() const;
- };
+ optional<std::wstring> get_environmental_variable(const wchar_t* varname) noexcept;
- std::wstring wdupenv_str(const wchar_t* varname) noexcept;
-}}
+ void set_environmental_variable(const wchar_t* varname, const wchar_t* varvalue) noexcept;
+}