From 87ccceeca33e6eef39d6de79907ca01a5668cc9b Mon Sep 17 00:00:00 2001 From: CaS Date: Sun, 6 Jan 2002 10:24:43 +0000 Subject: [PATCH] List all methods for a class git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12003 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 3 + Tools/AGSHtml.m | 269 +++++++++++++++++++++++------------------------- 2 files changed, 134 insertions(+), 138 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a3589112..585ae68bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * Tools/autogsdoc.m: Minor bugfix ... any .h file processed should also be processed as a .gsdoc file to produce indexes and html. + * Tools/AGSHtml.m: List *all* methods for a class in its method + summary, even if they are in categories or are documented in + other files. 2002-01-05 Richard Frith-Macdonald diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 8bbe4e3ab..e8fa26095 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -259,6 +259,131 @@ static NSMutableSet *textNodes = nil; return buf; } +- (void) outputIndex: (NSString*)type + scope: (NSString*)scope + title: (NSString*)title + to: (NSMutableString*)buf +{ + NSDictionary *dict = [localRefs refs]; + + if (globalRefs != nil && [scope isEqual: @"global"] == YES) + { + dict = [globalRefs refs]; + } + else if (projectRefs != nil && [scope isEqual: @"project"] == YES) + { + dict = [projectRefs refs]; + } + + dict = [dict objectForKey: type]; + if ([dict count] > 1 + || ([dict count] > 0 && [type isEqual: @"title"] == NO)) + { + NSArray *a = [dict allKeys]; + unsigned c = [a count]; + unsigned i; + NSString *sep = @""; + + if ([type isEqual: @"ivariable"]) + { + sep = @"*"; + } + a = [a sortedArrayUsingSelector: @selector(compare:)]; + + [buf appendString: indent]; + [buf appendFormat: @"%@\n", title]; + [buf appendString: indent]; + [buf appendString: @"\n"]; + } +} + - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf { CREATE_AUTORELEASE_POOL(arp); @@ -756,120 +881,9 @@ static NSMutableSet *textNodes = nil; { NSString *scope = [prop objectForKey: @"scope"]; NSString *type = [prop objectForKey: @"type"]; - NSDictionary *dict = [localRefs refs]; + NSString *title = [type capitalizedString]; - if (globalRefs != nil && [scope isEqual: @"global"] == YES) - { - dict = [globalRefs refs]; - } - else if (projectRefs != nil && [scope isEqual: @"project"] == YES) - { - dict = [projectRefs refs]; - } - - dict = [dict objectForKey: type]; - if ([dict count] > 1 - || ([dict count] > 0 && [type isEqual: @"title"] == NO)) - { - NSArray *a = [dict allKeys]; - unsigned c = [a count]; - unsigned i; - NSString *sep = @""; - - if ([type isEqual: @"ivariable"]) - { - sep = @"*"; - } - a = [a sortedArrayUsingSelector: @selector(compare:)]; - - [buf appendString: indent]; - [buf appendString: @"
\n"]; - [buf appendString: indent]; - [buf appendFormat: @"%@ index\n", - [type capitalizedString]]; - [buf appendString: indent]; - [buf appendString: @"\n"]; - } + [self outputIndex: type scope: scope title: title to: buf]; } else if ([name isEqual: @"ivar"] == YES) // %phrase { @@ -1570,31 +1584,10 @@ NSLog(@"Element '%@' not implemented", name); // FIXME a = [localRefs methodsInUnit: unit]; if ([a count] > 0) { - NSEnumerator *e; - NSString *s; - - [a sortUsingSelector: @selector(compare:)]; - [buf appendString: indent]; - [buf appendString: @"
\n"]; - [buf appendString: indent]; - [buf appendString: @"

Method summary

\n"]; - [buf appendString: indent]; - [buf appendString: @"\n"]; - [buf appendString: indent]; + [self outputIndex: @"method" + scope: @"global" + title: @"Method summary" + to: buf]; [buf appendString: @"
\n"]; } while (node != nil && [[node name] isEqual: @"method"] == YES)