mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
new method (addInformalProtocols:) to copy informal protocol refs (found by AGSOutput); also, in unitRef:type:unit:, return unit including category for category methods
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20088 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
48bfb76b9d
commit
4920b3a4da
1 changed files with 44 additions and 0 deletions
|
@ -471,6 +471,35 @@ setDirectory(NSMutableDictionary *dict, NSString *path)
|
|||
mergeDictionaries(refs, more, flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Informal protocols are not explicitly marked in source, but are
|
||||
* inferred to be those categories of NSObject that receive no
|
||||
* implementation. [AGSOutput] finds and accumulates them; autogsdoc
|
||||
* passes them here, where each entry is found in the 'category'
|
||||
* section of our refs and copied over to the protocol section.
|
||||
*/
|
||||
- (void) addInformalProtocols: (NSArray *)protocolNames
|
||||
{
|
||||
NSString *name;
|
||||
NSString *file;
|
||||
NSEnumerator *pnames = [protocolNames objectEnumerator];
|
||||
|
||||
//PENDING, should we worry about not overriding entries?
|
||||
while ((name = [pnames nextObject]) != nil)
|
||||
{
|
||||
file = [[refs objectForKey: @"category"] objectForKey: name];
|
||||
if (file != nil)
|
||||
{
|
||||
[[refs objectForKey: @"protocol"] setObject: file forKey: name];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Category entry not found for informal protocol '%@'", name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (NSArray*) methodsInUnit: (NSString*)aUnit
|
||||
{
|
||||
NSDictionary *d = [refs objectForKey: @"unitmethods"];
|
||||
|
@ -699,6 +728,21 @@ setDirectory(NSMutableDictionary *dict, NSString *path)
|
|||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
* (If unit is a category, method was probably indexed under the class,
|
||||
* so check it.)
|
||||
*/
|
||||
if ([*u length] > 0 && [*u characterAtIndex: [*u length] - 1] == ')')
|
||||
{
|
||||
NSString *className =
|
||||
[*u substringToIndex: [*u rangeOfString: @"("].location];
|
||||
s = [t objectForKey: className];
|
||||
if (s != nil)
|
||||
{
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If the unit that the method has been asked to look in is a
|
||||
* category or protocol which is not found, the lookup must fail.
|
||||
|
|
Loading…
Reference in a new issue