summaryrefslogtreecommitdiffstats
path: root/platform/windows/os_windows.cpp
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2022-12-29 21:06:11 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2023-01-11 19:57:25 +0100
commit86b8176864f1d9450855264bf7783467fd7b71d7 (patch)
tree51024e2dbb4e65125e300048af359eca89e8fd95 /platform/windows/os_windows.cpp
parenta75493091823020d858fabadbfa5994da0d658cb (diff)
downloadredot-engine-86b8176864f1d9450855264bf7783467fd7b71d7.tar.gz
Improve documentation for `OS.read_string_from_stdin()`
This makes it clearer that calls to this method are blocking. The unused method parameter was also removed.
Diffstat (limited to 'platform/windows/os_windows.cpp')
-rw-r--r--platform/windows/os_windows.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index f8633d29ac..35442511da 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1162,13 +1162,11 @@ bool OS_Windows::set_environment(const String &p_var, const String &p_value) con
return (bool)SetEnvironmentVariableW((LPCWSTR)(p_var.utf16().get_data()), (LPCWSTR)(p_value.utf16().get_data()));
}
-String OS_Windows::get_stdin_string(bool p_block) {
- if (p_block) {
- WCHAR buff[1024];
- DWORD count = 0;
- if (ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), buff, 1024, &count, nullptr)) {
- return String::utf16((const char16_t *)buff, count);
- }
+String OS_Windows::get_stdin_string() {
+ WCHAR buff[1024];
+ DWORD count = 0;
+ if (ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), buff, 1024, &count, nullptr)) {
+ return String::utf16((const char16_t *)buff, count);
}
return String();