use of org.eclipse.linuxtools.cdt.libhover.ClassInfo in project linuxtools by eclipse.
the class CDoxygenLibhoverGen method getClassInfo.
private ClassInfo getClassInfo(LibHoverInfo libHoverInfo, String className) {
// $NON-NLS-1$ //$NON-NLS-2$
String typedefName = className.replaceAll("<.*>", "<>");
TypedefInfo typedef = libHoverInfo.typedefs.get(typedefName);
if (typedef != null) {
// Reset class name to typedef transformation
className = typedef.getTransformedType(className);
}
int index = className.indexOf('<');
// Check if it is a template reference.
if (index != -1) {
// It is. We want to see if there are partial specific templates
// and we choose the first match. If nothing matches our particular
// case, we fall back on the initial generic template.
ClassInfo info = libHoverInfo.classes.get(className.substring(0, index));
if (info == null)
return null;
ArrayList<ClassInfo> children = info.getChildren();
if (children != null && children.size() > 0) {
for (int x = 0; x < children.size(); ++x) {
ClassInfo child = children.get(x);
if (className.matches(child.getClassName())) {
info = child;
break;
}
}
}
return info;
}
// Otherwise no template, just fetch the class info directly.
return libHoverInfo.classes.get(className);
}
Aggregations