diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-16 14:26:14 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-16 16:39:44 +0100 |
commit | 818a9e99a4bdbc6e3b12636ceff36759a778e848 (patch) | |
tree | dae35a70787bd6795f9738d54b8fe5008ff2ecac /core/os | |
parent | 04a39ecd846f40ac1049b699291f28b2f08e2185 (diff) |
OS: Add `unset_environment`, better validate input
Instead of returning an undocumented boolean error code, we do the
validation checks that should ensure a successful result.
Based on:
- https://linux.die.net/man/3/setenv
- https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setenvironmentvariable
Diffstat (limited to 'core/os')
-rw-r--r-- | core/os/os.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/os/os.h b/core/os/os.h index b80efa47b7..4818e9281a 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -167,7 +167,8 @@ public: virtual bool has_environment(const String &p_var) const = 0; virtual String get_environment(const String &p_var) const = 0; - virtual bool set_environment(const String &p_var, const String &p_value) const = 0; + virtual void set_environment(const String &p_var, const String &p_value) const = 0; + virtual void unset_environment(const String &p_var) const = 0; virtual String get_name() const = 0; virtual String get_distribution_name() const = 0; |