Package ghidra.app.util.demangler
Class DemangledType
- java.lang.Object
-
- ghidra.app.util.demangler.DemangledType
-
- Direct Known Subclasses:
DemangledDataType
,DemangledFunctionType
public class DemangledType extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected DemangledType
namespace
protected java.lang.String
originalMangled
protected DemangledTemplate
template
-
Constructor Summary
Constructors Constructor Description DemangledType(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DemangledType
convertToNamespace(GenericDemangledType otherNamespace)
Takes aDemangledType
with a name that contains namespace elements (such as Foo::Bar) and breaks it into a hierarchy of types where each type represents one item in the list of namespace elements.java.lang.String
getDemangledName()
Returns the unmodified demangled name of this object.java.lang.String
getName()
Get the name of this type.DemangledType
getNamespace()
java.lang.String
getOriginalMangled()
Sets the original mangled nameDemangledTemplate
getTemplate()
boolean
isConst()
boolean
isFunction()
boolean
isVolatile()
void
setConst()
void
setName(java.lang.String name)
Sets the name of the demangled type object.void
setNamespace(DemangledType namespace)
void
setOriginalMangled(java.lang.String mangled)
Sets the original mangled namevoid
setTemplate(DemangledTemplate template)
void
setVolatile()
java.lang.String
toNamespace()
java.lang.String
toSignature()
java.lang.String
toString()
-
-
-
Field Detail
-
originalMangled
protected java.lang.String originalMangled
-
namespace
protected DemangledType namespace
-
template
protected DemangledTemplate template
-
-
Method Detail
-
convertToNamespace
public static DemangledType convertToNamespace(GenericDemangledType otherNamespace)
Takes aDemangledType
with a name that contains namespace elements (such as Foo::Bar) and breaks it into a hierarchy of types where each type represents one item in the list of namespace elements.- Parameters:
demangledType
- the type to split- Returns:
- the original type if the name does not represent a namespace; a new type that contains a child, that contains a child and so on, representing the split-up of the original namespace string.
-
getDemangledName
public java.lang.String getDemangledName()
Returns the unmodified demangled name of this object. This name may contain whitespace and other characters not supported for symbol or data type creation. SeegetName()
for the same name modified for use within Ghidra.- Returns:
- name of this DemangledObject
-
getName
public java.lang.String getName()
Get the name of this type. NOTE: unsupported symbol characters, like whitespace, will be converted to an underscore.- Returns:
- name of this DemangledType suitable for namespace creation.
-
setName
public void setName(java.lang.String name)
Sets the name of the demangled type object.- Parameters:
name
- the new name
-
setOriginalMangled
public void setOriginalMangled(java.lang.String mangled)
Sets the original mangled name- Parameters:
mangled
- the original mangled name
-
getOriginalMangled
public java.lang.String getOriginalMangled()
Sets the original mangled name- Parameters:
mangled
- the original mangled name
-
isConst
public boolean isConst()
-
setConst
public void setConst()
-
isFunction
public boolean isFunction()
-
isVolatile
public boolean isVolatile()
-
setVolatile
public void setVolatile()
-
getNamespace
public DemangledType getNamespace()
-
setNamespace
public void setNamespace(DemangledType namespace)
-
getTemplate
public DemangledTemplate getTemplate()
-
setTemplate
public void setTemplate(DemangledTemplate template)
-
toSignature
public java.lang.String toSignature()
-
toNamespace
public java.lang.String toNamespace()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-