Package ghidra.app.util.demangler

# Class DemangledVariable

java.lang.Object
ghidra.app.util.demangler.DemangledObject
ghidra.app.util.demangler.DemangledVariable

All Implemented Interfaces:
  `Demangled`

public class DemangledVariable extends DemangledObject
An interface to represent a demangled global variable.

- ## Field Summary

  ### Fields inherited from class ghidra.app.util.demangler.DemangledObject

  `basedName, EMPTY_STRING, isRestrict, isStatic, isThunk, isUnaligned, isVirtual, mangled, memberScope, namespace, NAMESPACE_SEPARATOR, originalDemangled, SPACE, SPACE_PATTERN, specialPrefix, storageClass, visibility`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DemangledVariable(String mangled, String originalDemangled, String name)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `applyTo(Program program, Address address, DemanglerOptions options, TaskMonitor monitor)`
  Apply this demangled object detail to the specified program.
  `DemangledDataType`
  `getDataType()`
  Returns the data type of this variable.
  `String`
  `getName()`
  Returns the demangled name of this object.
  `String`
  `getSignature(boolean format)`
  Returns a complete signature for the demangled symbol.
  `protected boolean`
  `isAlreadyDemangled(Program program, Address address)`
  Determine if the symbol at address has already been demangled.
  `void`
  `setDatatype(DemangledDataType datatype)`

  ### Methods inherited from class ghidra.app.util.demangler.DemangledObject

  `applyDemangledName, applyDemangledName, applyPlateCommentOnly, createNamespace, demangledNameSuccessfully, ensureNameLength, generatePlateComment, getBasedName, getDemangledName, getErrorMessage, getMangledString, getMemberScope, getNamespace, getNamespaceName, getNamespaceString, getOriginalDemangled, getSignature, getSpecialPrefix, getStorageClass, getVisibility, isConst, isPointer64, isRestrict, isStatic, isThunk, isUnaligned, isVirtual, isVolatile, setBackupPlateComment, setBasedName, setConst, setErrorMessage, setMemberScope, setName, setNamespace, setPointer64, setRestrict, setSpecialPrefix, setStatic, setStorageClass, setThunk, setUnaligned, setVirtual, setVisibilty, setVolatile, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DemangledVariable

    public DemangledVariable(String mangled, String originalDemangled, String name)

- ## Method Details

  - ### setDatatype

    public void setDatatype(DemangledDataType datatype)

  - ### getDataType

    public DemangledDataType getDataType()
    Returns the data type of this variable.
    Returns:
      the data type of this variable

  - ### getSignature

    public String getSignature(boolean format)
    Description copied from class: `DemangledObject`
    Returns a complete signature for the demangled symbol.
    For example: "unsigned long foo" "unsigned char * ClassA::getFoo(float, short *)" "void * getBar(int **, MyStruct &)"
    Note: based on the underlying mangling scheme, the return type may or may not be specified in the signature.
    Specified by:
      `getSignature` in class `DemangledObject`
    Parameters:
      `format` - true if signature should be pretty printed
    Returns:
      a complete signature for the demangled symbol

  - ### isAlreadyDemangled

    protected boolean isAlreadyDemangled(Program program, Address address)
    Description copied from class: `DemangledObject`
    Determine if the symbol at address has already been demangled. While memory symbols check for presence of demangledName, external symbols simply check if demangled/alternate name has already been assigned.
    Overrides:
      `isAlreadyDemangled` in class `DemangledObject`
    Parameters:
      `program` - the program being modified
      `address` - address of demangled symbol
    Returns:
      true if symbol at address has already been demangled

  - ### applyTo

    public boolean applyTo(Program program, Address address, DemanglerOptions options, TaskMonitor monitor) throws Exception
    Description copied from class: `DemangledObject`
    Apply this demangled object detail to the specified program.
    NOTE: An open Program transaction must be established prior to invoking this method.
    Overrides:
      `applyTo` in class `DemangledObject`
    Parameters:
      `program` - program to which demangled data should be applied.
      `address` - address which corresponds to this demangled object
      `options` - options which control how demangled data is applied
      `monitor` - task monitor
    Returns:
      true if successfully applied, else false
    Throws:
      `Exception` - if an error occurs during the apply operation

  - ### getName

    public String getName()
    Description copied from interface: `Demangled`
    Returns the demangled name of this object. NOTE: unsupported symbol characters, like whitespace, will be converted to an underscore.
    Specified by:
      `getName` in interface `Demangled`
    Overrides:
      `getName` in class `DemangledObject`
    Returns:
      name of this DemangledObject with unsupported characters converted to underscore
    See Also:
      - `Demangled.getDemangledName()`