Package org.eclipse.cdt.core.dom.ast
Class ASTTypeUtil
- java.lang.Object
-
- org.eclipse.cdt.core.dom.ast.ASTTypeUtil
-
public class ASTTypeUtil extends java.lang.ObjectCollection of static methods for converting AST elements toStrings corresponding to the AST element's type.- Restriction:
- This class is not intended to be subclassed by clients.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidappendType(IType type, boolean normalize, java.lang.StringBuilder result)Appends the the result ofgetType(IType, boolean)to the given buffer.static char[]createNameForAnonymous(IBinding binding)static voidfinishTranslationUnit()Deprecated.This method is no longer used and is scheduled for removal in 10.0.static booleanfunctionTakesParameters(IFunction function)Returns whether the function matching the given function binding takes parameters or not.static java.lang.StringgetArgumentListString(ICPPTemplateArgument[] args, boolean normalize)Returns a comma-separated list of the string representations of the arguments, enclosed in angle brackets.static java.lang.StringgetArgumentString(ICPPTemplateArgument arg, boolean normalize)Returns a string representation for an template argument.static java.lang.StringgetNodeType(IASTNode node)For testing purposes, only.static java.lang.StringgetParameterTypeString(IFunctionType type)Returns a string representation for the parameters of the given function type.static java.lang.StringgetParameterTypeStringAndQualifiers(IFunctionType type)Returns a string representation for the parameters and the qualifiers of the given function type.static java.lang.String[]getParameterTypeStringArray(IFunctionType type)Returns an array of normalized string representations for the parameter types of the given function type.static java.lang.StringgetQualifiedName(ICPPBinding binding)Returns the qualified name for the given binding including template arguments.static java.lang.StringgetType(IASTDeclarator declarator)For testing purposes, only.static java.lang.StringgetType(IASTTypeId typeId)Returns the type representation of the IASTTypeId as a String.static java.lang.StringgetType(IType type)Returns the normalized string representation of the type.static java.lang.StringgetType(IType type, boolean normalize)Returns a string representation of a type.static java.lang.StringgetTypeListString(IType[] types)Returns a string representation for the type array.static java.lang.StringgetTypeListString(IType[] types, boolean normalize)Returns a String representation of the type array as a comma-separated list.static booleanisConst(IType type)Deprecated.don't use it does something strangestatic voidstartTranslationUnit()Deprecated.This method is no longer used and is scheduled for removal in 10.0.
-
-
-
Method Detail
-
getParameterTypeString
public static java.lang.String getParameterTypeString(IFunctionType type)
Returns a string representation for the parameters of the given function type. The representation contains the comma-separated list of the normalized parameter type representations wrapped in parentheses.
-
getParameterTypeStringAndQualifiers
public static java.lang.String getParameterTypeStringAndQualifiers(IFunctionType type)
Returns a string representation for the parameters and the qualifiers of the given function type. The representation contains the comma-separated list of the normalized parameter type representations wrapped in parentheses followed by the method qualifiers, if any.- Since:
- 5.11
-
functionTakesParameters
public static boolean functionTakesParameters(IFunction function)
Returns whether the function matching the given function binding takes parameters or not.- Since:
- 5.1
-
getTypeListString
public static java.lang.String getTypeListString(IType[] types)
Returns a string representation for the type array. The representation is a comma-separated list of the normalized string representations of the provided types.- See Also:
getTypeListString(IType[], boolean)
-
getTypeListString
public static java.lang.String getTypeListString(IType[] types, boolean normalize)
Returns a String representation of the type array as a comma-separated list.- Parameters:
types-normalize- indicates whether normalization shall be performed- Returns:
- representation of the type array as a comma-separated list
- Since:
- 5.1
-
getArgumentListString
public static java.lang.String getArgumentListString(ICPPTemplateArgument[] args, boolean normalize)
Returns a comma-separated list of the string representations of the arguments, enclosed in angle brackets. Optionally normalization is performed:
template parameter names are represented by their parameter position,
further normalization may be performed in future versions.- Parameters:
normalize- indicates whether normalization shall be performed- Since:
- 5.1
-
getArgumentString
public static java.lang.String getArgumentString(ICPPTemplateArgument arg, boolean normalize)
Returns a string representation for an template argument. Optionally normalization is performed:
template parameter names are represented by their parameter position,
further normalization may be performed in future versions.- Parameters:
normalize- indicates whether normalization shall be performed- Since:
- 5.1
-
getParameterTypeStringArray
public static java.lang.String[] getParameterTypeStringArray(IFunctionType type)
Returns an array of normalized string representations for the parameter types of the given function type.- See Also:
getType(IType, boolean)
-
getType
public static java.lang.String getType(IType type)
Returns the normalized string representation of the type.- See Also:
getType(IType, boolean)
-
getType
public static java.lang.String getType(IType type, boolean normalize)
Returns a string representation of a type. Optionally the representation is normalized:
typedefs are resolved
template parameter names are represented by their parameter position
further normalization may be performed in the future.- Parameters:
type- a type to compute the string representation for.normalize- whether or not normalization should be performed.- Returns:
- the type representation of the IType
-
appendType
public static void appendType(IType type, boolean normalize, java.lang.StringBuilder result)
Appends the the result ofgetType(IType, boolean)to the given buffer.- Since:
- 5.3
-
getType
public static java.lang.String getType(IASTDeclarator declarator)
For testing purposes, only. Returns the normalized string representation of the type defined by the given declarator.- Restriction:
- This method is not intended to be referenced by clients.
-
getNodeType
public static java.lang.String getNodeType(IASTNode node)
For testing purposes, only. Return's the String representation of a node's type (if available).- Restriction:
- This method is not intended to be referenced by clients.
-
getType
public static java.lang.String getType(IASTTypeId typeId)
Returns the type representation of the IASTTypeId as a String.- Parameters:
typeId-- Returns:
- the type representation of the IASTTypeId as a String
-
isConst
@Deprecated public static boolean isConst(IType type)
Deprecated.don't use it does something strange
-
getQualifiedName
public static java.lang.String getQualifiedName(ICPPBinding binding)
Returns the qualified name for the given binding including template arguments. If there are template arguments the arguments are neither normalized nor qualified.- Since:
- 5.3
-
createNameForAnonymous
public static char[] createNameForAnonymous(IBinding binding)
-
startTranslationUnit
@Deprecated public static void startTranslationUnit()
Deprecated.This method is no longer used and is scheduled for removal in 10.0.- Restriction:
- This method is not intended to be referenced by clients.
-
finishTranslationUnit
@Deprecated public static void finishTranslationUnit()
Deprecated.This method is no longer used and is scheduled for removal in 10.0.- Restriction:
- This method is not intended to be referenced by clients.
-
-