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> 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 * Tools/AGSOutput.m: Support (name) syntax for specifying a protocol
cross reference using [(name)-method] cross reference using [(name)-method]
* Tools/autogsdoc.m: Improve documentation of method references. * 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 - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf
{ {
NSMutableArray *a;
node = [node children]; node = [node children];
if (node != nil && [[node name] isEqual: @"declared"] == YES) if (node != nil && [[node name] isEqual: @"declared"] == YES)
{ {
@ -1203,6 +1205,31 @@ NSLog(@"Element '%@' not implemented", name); // FIXME
[self outputNode: node to: buf]; [self outputNode: node to: buf];
node = [node next]; 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) while (node != nil && [[node name] isEqual: @"method"] == YES)
{ {
[self outputNode: node to: buf]; [self outputNode: node to: buf];

View file

@ -33,6 +33,7 @@
- (NSString*) globalRef: (NSString*)ref type: (NSString*)type; - (NSString*) globalRef: (NSString*)ref type: (NSString*)type;
- (void) makeRefs: (GSXMLNode*)node; - (void) makeRefs: (GSXMLNode*)node;
- (void) mergeRefs: (NSDictionary*)more override: (BOOL)flag; - (void) mergeRefs: (NSDictionary*)more override: (BOOL)flag;
- (NSMutableArray*) methodsInUnit: (NSString*)aUnit;
- (NSMutableDictionary*) refs; - (NSMutableDictionary*) refs;
- (void) setDirectory: (NSString*)path; - (void) setDirectory: (NSString*)path;
- (void) setGlobalRef: (NSString*)ref type: (NSString*)type; - (void) setGlobalRef: (NSString*)ref type: (NSString*)type;

View file

@ -353,6 +353,25 @@ setDirectory(NSMutableDictionary *dict, NSString *path)
mergeDictionaries(refs, more, flag); 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 - (NSMutableDictionary*) refs
{ {
return refs; return refs;