OLD | NEW |
(Empty) | |
| 1 // -*- mode: ObjC -*- |
| 2 |
| 3 // This file is part of class-dump, a utility for examining the Objective-C seg
ment of Mach-O files. |
| 4 // Copyright (C) 1997-1998, 2000-2001, 2004-2010 Steve Nygard. |
| 5 |
| 6 #import "CDSearchPathState.h" |
| 7 |
| 8 @implementation CDSearchPathState |
| 9 |
| 10 - (id)init; |
| 11 { |
| 12 if ([super init] == nil) |
| 13 return nil; |
| 14 |
| 15 executablePath = nil; |
| 16 searchPathStack = [[NSMutableArray alloc] init]; |
| 17 |
| 18 return self; |
| 19 } |
| 20 |
| 21 - (void)dealloc; |
| 22 { |
| 23 [executablePath release]; |
| 24 [searchPathStack release]; |
| 25 |
| 26 [super dealloc]; |
| 27 } |
| 28 |
| 29 @synthesize executablePath; |
| 30 |
| 31 - (void)pushSearchPaths:(NSArray *)searchPaths; |
| 32 { |
| 33 [searchPathStack addObject:searchPaths]; |
| 34 } |
| 35 |
| 36 - (void)popSearchPaths; |
| 37 { |
| 38 if ([searchPathStack count] > 0) { |
| 39 [searchPathStack removeLastObject]; |
| 40 } else { |
| 41 NSLog(@"Warning: Unbalanced popSearchPaths"); |
| 42 } |
| 43 |
| 44 } |
| 45 |
| 46 - (NSString *)resolvePath:(NSString *)aPath; |
| 47 { |
| 48 for (NSArray *group in searchPathStack) { |
| 49 for (NSString *path in group) { |
| 50 NSLog(@"path %@", path); |
| 51 } |
| 52 } |
| 53 |
| 54 return aPath; |
| 55 } |
| 56 |
| 57 - (NSArray *)searchPaths; |
| 58 { |
| 59 NSMutableArray *result; |
| 60 |
| 61 result = [NSMutableArray array]; |
| 62 for (NSArray *group in searchPathStack) { |
| 63 [result addObjectsFromArray:group]; |
| 64 } |
| 65 |
| 66 return [NSArray arrayWithArray:result]; |
| 67 //return [[result copy] autorelease]; |
| 68 } |
| 69 |
| 70 @end |
OLD | NEW |