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

Side by Side Diff: class-dump/src/CDClassFrameworkVisitor.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/CDClassFrameworkVisitor.h ('k') | class-dump/src/CDDataCursor.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 "CDClassFrameworkVisitor.h"
7
8 #import "CDOCClass.h"
9 #import "CDObjectiveCProcessor.h"
10 #import "CDMachOFile.h"
11
12 // This builds up a dictionary mapping class names to a framework name. It is u sed to generate individual imports when creating separate header files.
13
14 @implementation CDClassFrameworkVisitor
15
16 - (id)init;
17 {
18 if ([super init] == nil)
19 return nil;
20
21 frameworkNamesByClassName = [[NSMutableDictionary alloc] init];
22 frameworkNamesByProtocolName = [[NSMutableDictionary alloc] init];
23 frameworkName = nil;
24
25 return self;
26 }
27
28 - (void)dealloc;
29 {
30 [frameworkNamesByClassName release];
31 [frameworkNamesByProtocolName release];
32 [frameworkName release];
33
34 [super dealloc];
35 }
36
37 - (NSDictionary *)frameworkNamesByClassName;
38 {
39 return frameworkNamesByClassName;
40 }
41
42 - (NSDictionary *)frameworkNamesByProtocolName;
43 {
44 return frameworkNamesByProtocolName;
45 }
46
47 - (NSString *)frameworkName;
48 {
49 return frameworkName;
50 }
51
52 - (void)setFrameworkName:(NSString *)newFrameworkName;
53 {
54 if (newFrameworkName == frameworkName)
55 return;
56
57 [frameworkName release];
58 frameworkName = [newFrameworkName retain];
59 }
60
61 - (void)willVisitObjectiveCProcessor:(CDObjectiveCProcessor *)anObjCSegment;
62 {
63 [self setFrameworkName:[[anObjCSegment machOFile] importBaseName]];
64 }
65
66 - (void)willVisitClass:(CDOCClass *)aClass;
67 {
68 if (frameworkName != nil) {
69 [frameworkNamesByClassName setObject:frameworkName forKey:[aClass name]] ;
70 }
71 }
72
73 - (void)willVisitProtocol:(CDOCProtocol *)aProtocol;
74 {
75 if (frameworkName != nil) {
76 [frameworkNamesByProtocolName setObject:frameworkName forKey:[aProtocol name]];
77 }
78 }
79
80 @end
OLDNEW
« no previous file with comments | « class-dump/src/CDClassFrameworkVisitor.h ('k') | class-dump/src/CDDataCursor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698