Permalink
Browse files

Fixed default parent handling for classes while parsing doxygen xml.

The problem is that doxygen doesn't mark all base classes properly. If we encounter such a class, we simply assume it's derived from NSObject. Although this doesn't always produce correct hieararchy tree, at least the classes appear in it... And technically speaking it's not wrong either since all classes derive from NSObject at the end... ;-)
  • Loading branch information...
1 parent e4db540 commit 3098d267a75303b1bb3c0f67126b3f8ed0ebe8a8 @tomaz committed Nov 18, 2009
Showing with 12 additions and 1 deletion.
  1. +12 −1 XMLOutputGenerator.m
View
@@ -166,9 +166,20 @@ - (void) createCleanObjectDocumentationMarkup
continue;
}
- // (D.1) Prepare the object's parent.
+ // (D.1) Prepare the object's parent. If the object doesn't have parent,
+ // just assume it's derived from NSObject. There's a bug in doxygen implementation
+ // which doesn't list some super classes - NSManagedObject for example...
+ // Although this doesn't properly work, at least the objects appear on the
+ // hierarchy. Note that we only do this for classes!
NSString* objectParent = nil;
NSArray* baseNodes = [objectNode nodesForXPath:@"base" error:nil];
+ if ([baseNodes count] == 0 && [objectKind isEqualToString:@"class"])
+ {
+ logInfo(@"- %@ class marked with no base, assuming NSObject!", objectName);
+ NSXMLElement* baseNode = [NSXMLElement elementWithName:@"base" stringValue:@"NSObject"];
+ [objectNode addChild:baseNode];
+ baseNodes = [objectNode nodesForXPath:@"base" error:nil];
+ }
if ([baseNodes count] > 0) objectParent = [[baseNodes objectAtIndex:0] stringValue];
// (E) Prepare the object relative directory and relative path to the index.

0 comments on commit 3098d26

Please sign in to comment.