diff options
| author | Thomas Fussell <thomas.fussell@gmail.com> | 2017-03-12 17:44:06 -0400 |
|---|---|---|
| committer | Thomas Fussell <thomas.fussell@gmail.com> | 2017-03-12 17:44:06 -0400 |
| commit | 2f42035ab43dd50cd863b51944aa099a99ae60f0 (patch) | |
| tree | 4b6cfd43955e946721c58028fd8564c861d5c331 /toolsrc/include/vcpkg_System.h | |
| parent | e02e85626f3206feda86a6f5757009005e0cfe3e (diff) | |
| parent | 1c9873a0daf625f67474aaf3e163c592c27ecb65 (diff) | |
| download | vcpkg-2f42035ab43dd50cd863b51944aa099a99ae60f0.tar.gz vcpkg-2f42035ab43dd50cd863b51944aa099a99ae60f0.zip | |
Merge branch 'master' of git://github.com/Microsoft/vcpkg
Diffstat (limited to 'toolsrc/include/vcpkg_System.h')
| -rw-r--r-- | toolsrc/include/vcpkg_System.h | 30 |
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; +} |
