mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Added toString method.
This commit is contained in:
parent
8111176e94
commit
9d578b5f13
1 changed files with 48 additions and 41 deletions
|
@ -46,6 +46,7 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
|
||||||
((ITypeContainer)getBinding()).setType(type);
|
((ITypeContainer)getBinding()).setType(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IASTName[] declarations = null;
|
private IASTName[] declarations = null;
|
||||||
private IType type = null;
|
private IType type = null;
|
||||||
|
|
||||||
|
@ -75,7 +76,7 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
|
||||||
public boolean isSameType(IType o) {
|
public boolean isSameType(IType o) {
|
||||||
if (o == this)
|
if (o == this)
|
||||||
return true;
|
return true;
|
||||||
if( o instanceof ITypedef )
|
if (o instanceof ITypedef) {
|
||||||
try {
|
try {
|
||||||
IType t = getType();
|
IType t = getType();
|
||||||
if (t != null)
|
if (t != null)
|
||||||
|
@ -84,6 +85,7 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IType t = getType();
|
IType t = getType();
|
||||||
if (t != null)
|
if (t != null)
|
||||||
|
@ -184,11 +186,12 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
|
||||||
return;
|
return;
|
||||||
IASTName name = (IASTName) node;
|
IASTName name = (IASTName) node;
|
||||||
|
|
||||||
if( declarations == null )
|
if (declarations == null) {
|
||||||
declarations = new IASTName[] { name };
|
declarations = new IASTName[] { name };
|
||||||
else {
|
} else {
|
||||||
// keep the lowest offset declaration in [0]
|
// keep the lowest offset declaration in [0]
|
||||||
if( declarations.length > 0 && ((ASTNode)node).getOffset() < ((ASTNode)declarations[0]).getOffset() ){
|
if (declarations.length > 0 &&
|
||||||
|
((ASTNode )node).getOffset() < ((ASTNode) declarations[0]).getOffset()) {
|
||||||
declarations = (IASTName[]) ArrayUtil.prepend(IASTName.class, declarations, name);
|
declarations = (IASTName[]) ArrayUtil.prepend(IASTName.class, declarations, name);
|
||||||
} else {
|
} else {
|
||||||
declarations = (IASTName[]) ArrayUtil.append(IASTName.class, declarations, name);
|
declarations = (IASTName[]) ArrayUtil.append(IASTName.class, declarations, name);
|
||||||
|
@ -203,4 +206,8 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
|
||||||
public ILinkage getLinkage() {
|
public ILinkage getLinkage() {
|
||||||
return Linkage.CPP_LINKAGE;
|
return Linkage.CPP_LINKAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue