List methods in unit

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11782 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2001-12-17 08:27:49 +00:00
parent 07fcefd463
commit 4083099aaf
4 changed files with 50 additions and 0 deletions

View file

@ -1,5 +1,8 @@
2001-12-17 Richard Frith-Macdonald <rfm@gnu.org>
* 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.

View file

@ -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: @"<h2>Methods</h2>\n"];
[buf appendString: indent];
[buf appendString: @"<ul>\n"];
[self incIndent];
e = [a objectEnumerator];
while ((s = [e nextObject]) != nil)
{
[buf appendString: indent];
[buf appendString: @"<li>"];
[buf appendString: [self makeLink: s ofType: @"method" isRef: YES]];
[buf appendString: s];
[buf appendString: @"</a></li>\n"];
}
[self decIndent];
[buf appendString: indent];
[buf appendString: @"</ul>\n"];
}
while (node != nil && [[node name] isEqual: @"method"] == YES)
{
[self outputNode: node to: buf];

View file

@ -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;

View file

@ -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;