summaryrefslogtreecommitdiff
path: root/core
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 /core
parenta75493091823020d858fabadbfa5994da0d658cb (diff)
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 'core')
-rw-r--r--core/core_bind.cpp6
-rw-r--r--core/core_bind.h2
-rw-r--r--core/os/os.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp
index 9503bd2575..df6d2c641c 100644
--- a/core/core_bind.cpp
+++ b/core/core_bind.cpp
@@ -257,8 +257,8 @@ Error OS::shell_open(String p_uri) {
return ::OS::get_singleton()->shell_open(p_uri);
}
-String OS::read_string_from_stdin(bool p_block) {
- return ::OS::get_singleton()->get_stdin_string(true);
+String OS::read_string_from_stdin() {
+ return ::OS::get_singleton()->get_stdin_string();
}
int OS::execute(const String &p_path, const Vector<String> &p_arguments, Array r_output, bool p_read_stderr, bool p_open_console) {
@@ -539,7 +539,7 @@ void OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_system_font_path", "font_name", "weight", "stretch", "italic"), &OS::get_system_font_path, DEFVAL(400), DEFVAL(100), DEFVAL(false));
ClassDB::bind_method(D_METHOD("get_system_font_path_for_text", "font_name", "text", "locale", "script", "weight", "stretch", "italic"), &OS::get_system_font_path_for_text, DEFVAL(String()), DEFVAL(String()), DEFVAL(400), DEFVAL(100), DEFVAL(false));
ClassDB::bind_method(D_METHOD("get_executable_path"), &OS::get_executable_path);
- ClassDB::bind_method(D_METHOD("read_string_from_stdin", "block"), &OS::read_string_from_stdin, DEFVAL(true));
+ ClassDB::bind_method(D_METHOD("read_string_from_stdin"), &OS::read_string_from_stdin);
ClassDB::bind_method(D_METHOD("execute", "path", "arguments", "output", "read_stderr", "open_console"), &OS::execute, DEFVAL(Array()), DEFVAL(false), DEFVAL(false));
ClassDB::bind_method(D_METHOD("create_process", "path", "arguments", "open_console"), &OS::create_process, DEFVAL(false));
ClassDB::bind_method(D_METHOD("create_instance", "arguments"), &OS::create_instance);
diff --git a/core/core_bind.h b/core/core_bind.h
index c863a8094c..f6bef50945 100644
--- a/core/core_bind.h
+++ b/core/core_bind.h
@@ -173,7 +173,7 @@ public:
String get_system_font_path(const String &p_font_name, int p_weight = 400, int p_stretch = 100, bool p_italic = false) const;
Vector<String> get_system_font_path_for_text(const String &p_font_name, const String &p_text, const String &p_locale = String(), const String &p_script = String(), int p_weight = 400, int p_stretch = 100, bool p_italic = false) const;
String get_executable_path() const;
- String read_string_from_stdin(bool p_block = true);
+ String read_string_from_stdin();
int execute(const String &p_path, const Vector<String> &p_arguments, Array r_output = Array(), bool p_read_stderr = false, bool p_open_console = false);
int create_process(const String &p_path, const Vector<String> &p_arguments, bool p_open_console = false);
int create_instance(const Vector<String> &p_arguments);
diff --git a/core/os/os.h b/core/os/os.h
index 07e9020a51..8ddfe4d979 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -130,7 +130,7 @@ public:
void print_rich(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;
void printerr(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;
- virtual String get_stdin_string(bool p_block = true) = 0;
+ virtual String get_stdin_string() = 0;
virtual Error get_entropy(uint8_t *r_buffer, int p_bytes) = 0; // Should return cryptographically-safe random bytes.