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

Unified Diff: class-dump/src/CDOCCategory.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/CDOCCategory.h ('k') | class-dump/src/CDOCClass.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: class-dump/src/CDOCCategory.m
===================================================================
--- class-dump/src/CDOCCategory.m (revision 0)
+++ class-dump/src/CDOCCategory.m (revision 0)
@@ -0,0 +1,97 @@
+// -*- 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 "CDOCCategory.h"
+
+#import "CDClassDump.h"
+#import "CDOCMethod.h"
+#import "CDSymbolReferences.h"
+#import "NSArray-Extensions.h"
+#import "CDVisitor.h"
+#import "CDVisitorPropertyState.h"
+
+@implementation CDOCCategory
+
+- (void)dealloc;
+{
+ [className release];
+
+ [super dealloc];
+}
+
+- (NSString *)className;
+{
+ return className;
+}
+
+- (void)setClassName:(NSString *)newClassName;
+{
+ if (newClassName == className)
+ return;
+
+ [className release];
+ className = [newClassName retain];
+}
+
+- (NSString *)sortableName;
+{
+ return [NSString stringWithFormat:@"%@ (%@)", className, name];
+}
+
+- (NSString *)findTag:(CDSymbolReferences *)symbolReferences;
+{
+ NSMutableString *resultString = [NSMutableString string];
+
+ [resultString appendFormat:@"@interface %@ (%@)", className, name];
+
+ 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 willVisitCategory:self];
+
+ //[aVisitor willVisitPropertiesOfCategory:self];
+ //[self visitProperties:aVisitor];
+ //[aVisitor didVisitPropertiesOfCategory:self];
+
+ [self visitMethods:aVisitor propertyState:propertyState];
+ // This can happen when... the accessors are implemented on the main class. Odd case, but we should still emit the remaining properties.
+ // Should mostly be dynamic properties
+ [aVisitor visitRemainingProperties:propertyState];
+ [aVisitor didVisitCategory:self];
+
+ [propertyState release];
+}
+
+//
+// CDTopologicalSort protocol
+//
+
+- (NSString *)identifier;
+{
+ return [self sortableName];
+}
+
+- (NSArray *)dependancies;
+{
+ if (className == nil)
+ return [NSArray array];
+
+ return [NSArray arrayWithObject:className];
+}
+
+@end
Property changes on: class-dump/src/CDOCCategory.m
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « class-dump/src/CDOCCategory.h ('k') | class-dump/src/CDOCClass.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698