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

Unified Diff: class-dump/src/CDOCClass.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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « class-dump/src/CDOCClass.h ('k') | class-dump/src/CDOCIvar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: class-dump/src/CDOCClass.m
===================================================================
--- class-dump/src/CDOCClass.m (revision 0)
+++ class-dump/src/CDOCClass.m (revision 0)
@@ -0,0 +1,146 @@
+// -*- mode: ObjC -*-
+
+// This file is part of class-dump, a utility for examining the Objective-C segment of Mach-O files.
+// Copyright (C) 1997-1998, 2000-2001, 2004-2010 Steve Nygard.
+
+#import "CDOCClass.h"
+
+#import "NSArray-Extensions.h"
+#import "CDClassDump.h"
+#import "CDOCIvar.h"
+#import "CDOCMethod.h"
+#import "CDSymbolReferences.h"
+#import "CDType.h"
+#import "CDTypeController.h"
+#import "CDTypeParser.h"
+#import "CDVisitor.h"
+#import "CDVisitorPropertyState.h"
+
+@implementation CDOCClass
+
+- (id)init;
+{
+ if ([super init] == nil)
+ return nil;
+
+ superClassName = nil;
+ ivars = nil;
+
+ isExported = YES;
+
+ return self;
+}
+
+- (void)dealloc;
+{
+ [superClassName release];
+ [ivars release];
+
+ [super dealloc];
+}
+
+- (NSString *)superClassName;
+{
+ return superClassName;
+}
+
+- (void)setSuperClassName:(NSString *)newSuperClassName;
+{
+ if (newSuperClassName == superClassName)
+ return;
+
+ [superClassName release];
+ superClassName = [newSuperClassName retain];
+}
+
+- (NSArray *)ivars;
+{
+ return ivars;
+}
+
+- (void)setIvars:(NSArray *)newIvars;
+{
+ if (newIvars == ivars)
+ return;
+
+ [ivars release];
+ ivars = [newIvars retain];
+}
+
+@synthesize isExported;
+
+- (NSString *)description;
+{
+ return [NSString stringWithFormat:@"%@, exported: %@", [super description], isExported ? @"YES" : @"NO"];
+}
+
+- (void)registerTypesWithObject:(CDTypeController *)typeController phase:(NSUInteger)phase;
+{
+ [super registerTypesWithObject:typeController phase:phase];
+
+ for (CDOCIvar *ivar in ivars) {
+ [[ivar parsedType] phase:phase registerTypesWithObject:typeController usedInMethod:NO];
+ }
+}
+
+- (NSString *)findTag:(CDSymbolReferences *)symbolReferences;
+{
+ NSMutableString *resultString = [NSMutableString string];
+
+ [resultString appendFormat:@"@interface %@", name];
+ if (superClassName != nil)
+ [resultString appendFormat:@" : %@", superClassName];
+
+ if ([protocols count] > 0)
+ [resultString appendFormat:@" <%@>", [[protocols arrayByMappingSelector:@selector(name)] componentsJoinedByString:@", "]];
+
+ return resultString;
+}
+
+- (void)recursivelyVisit:(CDVisitor *)aVisitor;
+{
+ CDVisitorPropertyState *propertyState;
+
+ if ([[aVisitor classDump] shouldMatchRegex] && [[aVisitor classDump] regexMatchesString:[self name]] == NO)
+ return;
+
+ // Wonderful. Need to typecast because there's also -[NSHTTPCookie initWithProperties:] that takes a dictionary.
+ propertyState = [(CDVisitorPropertyState *)[CDVisitorPropertyState alloc] initWithProperties:[self properties]];
+
+ [aVisitor willVisitClass:self];
+
+ [aVisitor willVisitIvarsOfClass:self];
+ for (CDOCIvar *ivar in ivars)
+ [aVisitor visitIvar:ivar];
+ [aVisitor didVisitIvarsOfClass:self];
+
+ //[aVisitor willVisitPropertiesOfClass:self];
+ //[self visitProperties:aVisitor];
+ //[aVisitor didVisitPropertiesOfClass:self];
+
+ [self visitMethods:aVisitor propertyState:propertyState];
+ // Should mostly be dynamic properties
+ [aVisitor visitRemainingProperties:propertyState];
+ [aVisitor didVisitClass:self];
+
+ [propertyState release];
+}
+
+//
+// CDTopologicalSort protocol
+//
+
+- (NSString *)identifier;
+{
+ return [self name];
+}
+
+- (NSArray *)dependancies;
+{
+ if (superClassName == nil)
+ return [NSArray array];
+
+ return [NSArray arrayWithObject:superClassName];
+}
+
+@end
Property changes on: class-dump/src/CDOCClass.m
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « class-dump/src/CDOCClass.h ('k') | class-dump/src/CDOCIvar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698