/////////////////////////////////////////////////////////////////////////////
-// Name: utilsexec.mm
+// Name: src/cocoa/utilsexec.mm
// Purpose: Execution-related utilities for wxCocoa
// Author: Ryan Norton
// Modified by:
// RCS-ID: $Id$
// Copyright: (c) Ryan Norton
// Licence: wxWindows licence
+// Notes: This code may be useful on platforms other than Darwin.
+// On Darwin we share the CoreFoundation code with wxMac.
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
#endif
+#include "wx/unix/execute.h"
+#include "wx/utils.h"
+
+#if 0
#include "wx/utils.h"
#import <Foundation/Foundation.h>
#import <AppKit/NSWorkspace.h>
+//
+// RN: This is a prelimenary implementation - simple
+// launching and process redirection works,
+// but with the piping tests in the exec sample
+// SIGPIPE is triggered...
+//
+
class wxPipeInputStream : public wxInputStream
{
public:
@end
long wxExecute(const wxString& command,
- int sync = wxEXEC_ASYNC,
- wxProcess *handle = NULL)
+ int sync,
+ wxProcess *handle)
{
NSTask* theTask = [[NSTask alloc] init];
NSArray* theQuoteArguments =
[wxNSStringWithWxString(command) componentsSeparatedByString:@"\""];
- NSMutableArray* theSeperatedArguments =
+ NSMutableArray* theSeparatedArguments =
[NSMutableArray arrayWithCapacity:10];
for (unsigned i = 0; i < [theQuoteArguments count]; ++i)
{
- [theSeperatedArguments addObjectsFromArray:
+ [theSeparatedArguments addObjectsFromArray:
[[theQuoteArguments objectAtIndex:i] componentsSeparatedByString:@" "]
];
if(++i < [theQuoteArguments count])
- [theSeperatedArguments addObject:[theQuoteArguments objectAtIndex:i]];
+ [theSeparatedArguments addObject:[theQuoteArguments objectAtIndex:i]];
}
- [theTask setLaunchPath:[theSeperatedArguments objectAtIndex:0]];
- [theTask setArguments:theSeperatedArguments];
+ [theTask setLaunchPath:[theSeparatedArguments objectAtIndex:0]];
+ [theTask setArguments:theSeparatedArguments];
[theTask launch];
if(sync & wxEXEC_ASYNC)
return [theTask terminationStatus];
}
-}
\ No newline at end of file
+}
+#endif //0
+