Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: class-dump/src/CDTypeName.m

Issue 7793008: Add the 3.3.3 sources for class-dump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « class-dump/src/CDTypeName.h ('k') | class-dump/src/CDTypeParser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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 "CDTypeName.h"
7
8 @implementation CDTypeName
9
10 - (id)init;
11 {
12 if ([super init] == nil)
13 return nil;
14
15 name = nil;
16 templateTypes = [[NSMutableArray alloc] init];
17 suffix = nil;
18
19 return self;
20 }
21
22 - (void)dealloc;
23 {
24 [name release];
25 [templateTypes release];
26 [suffix release];
27
28 [super dealloc];
29 }
30
31 @synthesize name;
32
33 - (NSArray *)templateTypes;
34 {
35 return templateTypes;
36 }
37
38 - (void)addTemplateType:(CDTypeName *)aTemplateType;
39 {
40 [templateTypes addObject:aTemplateType];
41 }
42
43 @synthesize suffix;
44
45 - (NSString *)description;
46 {
47 if ([templateTypes count] == 0)
48 return name;
49
50 if (suffix != nil)
51 return [NSString stringWithFormat:@"%@<%@>%@", name, [templateTypes comp onentsJoinedByString:@", "], suffix];
52
53 return [NSString stringWithFormat:@"%@<%@>", name, [templateTypes components JoinedByString:@", "]];
54 }
55
56 - (BOOL)isTemplateType;
57 {
58 return [templateTypes count] > 0;
59 }
60
61 - (BOOL)isEqual:(id)otherObject;
62 {
63 if ([otherObject isKindOfClass:[self class]] == NO)
64 return NO;
65
66 return [[self description] isEqual:[otherObject description]];
67 }
68
69 - (id)copyWithZone:(NSZone *)zone;
70 {
71 CDTypeName *copy;
72
73 copy = [[CDTypeName alloc] init];
74 [copy setName:name];
75 [copy setSuffix:suffix];
76
77 for (CDTypeName *subtype in templateTypes) {
78 CDTypeName *subcopy;
79
80 subcopy = [subtype copy];
81 [copy addTemplateType:subcopy];
82 [subcopy release];
83 }
84
85 return copy;
86 }
87
88 @end
OLDNEW
« no previous file with comments | « class-dump/src/CDTypeName.h ('k') | class-dump/src/CDTypeParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698