Files
gitx/PBEasyPipe.h
T
André Berg 6c04aea44b Bug fix: Change improper usage of dot notation.
Calling methods which are not properties through use of dot notation is a
no-no in Apple's Objective-C 2.0 documentation. According to Apple it might
work but the compiler will not warn about any dangerous use cases.

The prominent example from the docs of how not to do it is "someObject.retain".

Here retain is a method and not a property so proper use is "[someObject retain]".
Unfortunately, often it is not clear if something in the API is merely an accessor
or a method which acts like an accessor but does more than the name might imply.

In this case, we can see this in PBEasyPipe where we have method calls like
"NSTask.standardOutput = ...". Even though they may look correct this can be
dangerous for obvious reasons. I assume hat this could also play a role in the appearance
of the "bad file descriptor" messages.
2009-10-20 04:03:05 +02:00

28 lines
1.1 KiB
Objective-C

//
// PBEasyPipe.h
// GitX
//
// Created by Pieter de Bie on 16-06-08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface PBEasyPipe : NSObject {
}
+ (NSTask *) taskForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir;
+ (NSFileHandle *) handleForCommand:(NSString *)cmd withArgs:(NSArray *)args;
+ (NSFileHandle *) handleForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir;
+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args;
+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir;
+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir retValue:(int *)ret;
+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir inputString:(NSString *)input retValue:(int *)ret;
+ (NSString *) outputForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir byExtendingEnvironment:(NSDictionary *)dict inputString:(NSString *)input retValue:(int *)ret;
@end