diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2018-03-23 11:56:05 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2018-03-23 11:56:05 +0200 |
commit | d6c6a654386b076d94ce9fe8a62651b4fda54ba9 (patch) | |
tree | 36d9d2b54b8a206f974500db0221296801451afa | |
parent | c537107af9b27f328b25a631149a19f937d301f6 (diff) |
Revert "Implement OS_OSX::execute"
This reverts commit e42576548f2c0ae2c6cb24ce2b0437ffb8978d65.
-rw-r--r-- | platform/osx/os_osx.h | 1 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 49 |
2 files changed, 0 insertions, 50 deletions
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index 72ca8969d0..fee25e98cb 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -195,7 +195,6 @@ public: virtual VideoMode get_video_mode(int p_screen = 0) const; virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen = 0) const; - virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id, String *r_pipe, int *r_exitcode, bool p_read_stderr); virtual String get_executable_path() const; virtual LatinKeyboardVariant get_latin_keyboard_variant() const; diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 0e7c0f1a4e..ef23d61141 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -2046,55 +2046,6 @@ bool OS_OSX::get_borderless_window() { return [window_object styleMask] == NSWindowStyleMaskBorderless; } -Error OS_OSX::execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id, String *r_pipe, int *r_exitcode, bool p_read_stderr) { - - NSTask *task = [[NSTask alloc] init]; - NSPipe *stdout_pipe = nil; - [task setLaunchPath:[NSString stringWithUTF8String:p_path.utf8().get_data()]]; - - NSMutableArray *arguments = [[NSMutableArray alloc] initWithCapacity:p_arguments.size()]; - for (int i = 0; i < p_arguments.size(); i++) { - [arguments addObject:[NSString stringWithUTF8String:p_arguments[i].utf8().get_data()]]; - } - [task setArguments:arguments]; - - if (p_blocking && r_pipe) { - stdout_pipe = [NSPipe pipe]; - [task setStandardOutput:stdout_pipe]; - if (p_read_stderr) [task setStandardError:[task standardOutput]]; - } - - @try { - [task launch]; - if (r_child_id) - *r_child_id = [task processIdentifier]; - - if (p_blocking) { - if (r_pipe) { - NSFileHandle *read_handle = [stdout_pipe fileHandleForReading]; - NSData *data = nil; - while ((data = [read_handle availableData]) && [data length]) { - NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - (*r_pipe) += [string UTF8String]; - [string release]; - } - } else { - [task waitUntilExit]; - } - } - - [arguments release]; - [task release]; - return OK; - } @catch (NSException *exception) { - ERR_PRINTS("NSException: " + String([exception reason].UTF8String) + "; Path: " + p_path); - - [arguments release]; - [task release]; - return ERR_CANT_OPEN; - } -} - String OS_OSX::get_executable_path() const { int ret; |