Interface Demangled

All Known Implementing Classes:
AbstractDemangledFunctionDefinitionDataType, DemangledAddressTable, DemangledDataType, DemangledFunction, DemangledFunctionIndirect, DemangledFunctionPointer, DemangledFunctionReference, DemangledLabel, DemangledLambda, DemangledList, DemangledObject, DemangledString, DemangledStructure, DemangledThunk, DemangledType, DemangledUnknown, DemangledVariable

public interface Demangled
A unifying top-level interface for all DemangledObjects and DemangledTypes

This class and its children have many overlapping concepts that we wish to refine at a future date. Below is a listing of known uses:

MethodDescription
getName() A 'safe' name that is the getDemangledName(), but with some characters changed to be valid for use within Ghidra.
getDemangledName() The unmodified name that was set upon this object.
getNamespaceName() The 'safe' name of this object when it is used as a namespace name. This usually has parameter and template information. Further, some characters within templates and function signatures are replaced, such as spaces and namespace separators.

Given this full demangled string: Foo::Bar::Baz<int>, this method will return Baz<int>.

getNamespaceString() This returns the unmodified name of this item, along with any unmodified parent namespace names, all separated by a namespace delimiter. Unlike getNamespaceName(), the spaces and internal namespace tokens will not be replaced.

Given this full demangled string: Foo::Bar::Baz<int>, this method will return Foo::Bar::Baz<int>.

getSignature() Returns the complete string form of this object, with most known attributes. For functions, this will be a complete signature.
getOriginalDemangled() The original unmodified demangled string. This is the full demangled string returned from the demangling service.
  • Method Details

    • getMangledString

      String getMangledString()
      Returns the original mangled string
      Returns:
      the string
    • getOriginalDemangled

      String getOriginalDemangled()
      Returns the original demangled string returned by the demangling service
      Returns:
      the original demangled string
    • getName

      String getName()
      Returns the demangled name of this object. NOTE: unsupported symbol characters, like whitespace, will be converted to an underscore.
      Returns:
      name of this DemangledObject with unsupported characters converted to underscore
      See Also:
    • setName

      void setName(String name)
      Sets the name for this object
      Parameters:
      name - the name
    • getDemangledName

      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. See getName() for the same name modified for use within Ghidra.
      Returns:
      name of this DemangledObject
    • getNamespace

      Demangled getNamespace()
      Returns the namespace containing this demangled object
      Returns:
      the namespace containing this demangled object
    • setNamespace

      void setNamespace(Demangled ns)
      Sets the namespace of this demangled object
      Parameters:
      ns - the namespace
    • getNamespaceString

      String getNamespaceString()
      Returns a representation of this object as fully-qualified namespace. The value returned here may have had some special characters replaced, such as ' ' replaced with '_' and '::' replaced with '--'.
      Returns:
      the full namespace
    • getNamespaceName

      String getNamespaceName()
      Returns this object's namespace name without the fully-qualified parent path. The value returned here may have had some special characters replaced, such as ' ' replaced with '_' and '::' replaced with '--'.
      Returns:
      the name
    • getSignature

      String getSignature()
      Generates a complete representation of this object to include all know attributes of this object
      Returns:
      the signature