diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-01-29 22:59:38 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-02-03 05:38:47 +0100 |
commit | 41873ffa88da0a30189d66b75a8e65ee49645bc2 (patch) | |
tree | 37a639ce3732b181365bede3a41b889ac504c824 /platform/windows | |
parent | d3c51a5dfb5fb26081d64e16b198ee9ae1beb481 (diff) |
Added set_environment to OS class
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/os_windows.cpp | 5 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 35f9d541ef..9ae1be9afd 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2604,6 +2604,11 @@ String OS_Windows::get_environment(const String &p_var) const { return ""; } +bool OS_Windows::set_environment(const String &p_var, const String &p_value) const { + + return (bool)SetEnvironmentVariableW(p_var.c_str(), p_value.c_str()); +} + String OS_Windows::get_stdin_string(bool p_block) { if (p_block) { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 4936a69120..771789c86b 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -268,6 +268,7 @@ public: virtual bool has_environment(const String &p_var) const; virtual String get_environment(const String &p_var) const; + virtual bool set_environment(const String &p_var, const String &p_value) const; virtual void set_clipboard(const String &p_text); virtual String get_clipboard() const; |