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.
This commit is contained in:
parent
a754930918
commit
86b8176864
10 changed files with 19 additions and 26 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ protected:
|
|||
|
||||
virtual void finalize() override;
|
||||
virtual void finalize_core() override;
|
||||
virtual String get_stdin_string(bool p_block) override;
|
||||
virtual String get_stdin_string() override;
|
||||
|
||||
String _quote_command_line_argument(const String &p_text) const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue