diff --git a/ChangeLog b/ChangeLog index 512152c08..55b931091 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2001-12-17 Richard Frith-Macdonald + * Tools/AGSHtml.m: Provide list of methods in each class. + * Tools/AGSIndex.m: New method to list methods in a unit. + * Tools/AGSIndex.h: New method to list methods in a unit. * Tools/AGSOutput.m: Support (name) syntax for specifying a protocol cross reference using [(name)-method] * Tools/autogsdoc.m: Improve documentation of method references. diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 0e7dbaaf7..f257ad455 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -1179,6 +1179,8 @@ NSLog(@"Element '%@' not implemented", name); // FIXME - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf { + NSMutableArray *a; + node = [node children]; if (node != nil && [[node name] isEqual: @"declared"] == YES) { @@ -1203,6 +1205,31 @@ NSLog(@"Element '%@' not implemented", name); // FIXME [self outputNode: node to: buf]; node = [node next]; } + a = [localRefs methodsInUnit: unit]; + if ([a count] > 0) + { + NSEnumerator *e; + NSString *s; + + [a sortUsingSelector: @selector(compare:)]; + [buf appendString: indent]; + [buf appendString: @"

Methods

\n"]; + [buf appendString: indent]; + [buf appendString: @"\n"]; + } while (node != nil && [[node name] isEqual: @"method"] == YES) { [self outputNode: node to: buf]; diff --git a/Tools/AGSIndex.h b/Tools/AGSIndex.h index e5a995e55..6e391ce00 100644 --- a/Tools/AGSIndex.h +++ b/Tools/AGSIndex.h @@ -33,6 +33,7 @@ - (NSString*) globalRef: (NSString*)ref type: (NSString*)type; - (void) makeRefs: (GSXMLNode*)node; - (void) mergeRefs: (NSDictionary*)more override: (BOOL)flag; +- (NSMutableArray*) methodsInUnit: (NSString*)aUnit; - (NSMutableDictionary*) refs; - (void) setDirectory: (NSString*)path; - (void) setGlobalRef: (NSString*)ref type: (NSString*)type; diff --git a/Tools/AGSIndex.m b/Tools/AGSIndex.m index 066cb8471..09f58f361 100644 --- a/Tools/AGSIndex.m +++ b/Tools/AGSIndex.m @@ -353,6 +353,25 @@ setDirectory(NSMutableDictionary *dict, NSString *path) mergeDictionaries(refs, more, flag); } +- (NSMutableArray*) methodsInUnit: (NSString*)aUnit +{ + NSDictionary *d = [refs objectForKey: @"method"]; + NSEnumerator *e = [d keyEnumerator]; + NSMutableArray *a = [NSMutableArray array]; + NSString *k; + + while ((k = [e nextObject]) != nil) + { + NSDictionary *m = [d objectForKey: k]; + + if ([m objectForKey: aUnit] != nil) + { + [a addObject: k]; + } + } + return a; +} + - (NSMutableDictionary*) refs { return refs;