summaryrefslogtreecommitdiffstats
path: root/core/core_bind.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-10-03 14:08:00 +0200
committerGitHub <noreply@github.com>2022-10-03 14:08:00 +0200
commit04a28763c01e88f6e5758d3182810a6a7ddab4e9 (patch)
tree3742a3541912151f7321bfd61f0747bc35cad0ce /core/core_bind.cpp
parent9e50007df60defa9b2222621edb298ddf06472a4 (diff)
parent8b5bb7eeeaf666dc7bb390a16599c6674d34a8ed (diff)
downloadredot-engine-04a28763c01e88f6e5758d3182810a6a7ddab4e9.tar.gz
Merge pull request #65751 from Faless/os/4.x_expose_read_from_stdin
Diffstat (limited to 'core/core_bind.cpp')
-rw-r--r--core/core_bind.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp
index a164221fc2..1582e8e983 100644
--- a/core/core_bind.cpp
+++ b/core/core_bind.cpp
@@ -253,6 +253,10 @@ 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);
+}
+
int OS::execute(const String &p_path, const Vector<String> &p_arguments, Array r_output, bool p_read_stderr, bool p_open_console) {
List<String> args;
for (int i = 0; i < p_arguments.size(); i++) {
@@ -530,6 +534,7 @@ void OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_system_fonts"), &OS::get_system_fonts);
ClassDB::bind_method(D_METHOD("get_system_font_path", "font_name", "bold", "italic"), &OS::get_system_font_path, DEFVAL(false), 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("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);