-
Notifications
You must be signed in to change notification settings - Fork 27
/
TCTaskWrapperWithBlocks.h
32 lines (25 loc) · 1.04 KB
/
TCTaskWrapperWithBlocks.h
1
#import <Foundation/Foundation.h>@interface TCTaskWrapperWithBlocks : NSObject { NSTask *task; void (^StartBlock)(void); void (^EndBlock)(void); void (^OutputBlock)(NSString *output); void (^ErrorOutputBlock)(NSString *errorOutput); NSArray *arguments; BOOL isBinaryOutput;}// This is the designated initializer - pass in your controller and any task arguments.// The first argument should be the path to the executable to launch with the NSTask.- (id)initWithStartBlock:(void(^)(void))inStartBlock endBlock:(void(^)(void))inEndBlock outputBlock:(void(^)(NSString *output))inOutputBlock errorOutputBlock:(void(^)(NSString *errorOutput))inErrorOutputBlockBlock arguments:(NSArray *)args;// This method launches the process, setting up asynchronous feedback notifications.- (void) startProcess;// This method stops the process, stoping asynchronous feedback notifications.- (void) stopProcess;-(int)terminationStatus;-(BOOL)isRunning;-(void)terminate;@end