Package ghidra.app.cmd.data

# Class CreateDataInStructureBackgroundCmd

java.lang.Object
ghidra.framework.cmd.BackgroundCommand<Program>
ghidra.app.cmd.data.CreateDataInStructureBackgroundCmd

All Implemented Interfaces:
  `Command<Program>`

public class CreateDataInStructureBackgroundCmd extends BackgroundCommand<Program>
Background command to create data across a selection inside of a structure.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CreateDataInStructureBackgroundCmd(Address addr, int[] startPath, int length, DataType dt)`
  Constructs a command for applying dataTypes within an existing structure across a range of components.
  `CreateDataInStructureBackgroundCmd(Address addr, int[] startPath, int length, DataType dt, boolean stackPointers)`
  This is the same as `CreateDataInStructureBackgroundCmd(Address, int[], int, DataType)` except that it allows the caller to control whether or not a pointer data type is created when a non-pointer data type is applied at a location that previously contained a pointer data type.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `applyTo(Program program, TaskMonitor monitor)`
  Method called when this command is to apply changes to the given domain object.

  ### Methods inherited from class ghidra.framework.cmd.BackgroundCommand

  `applyTo, canCancel, dispose, getName, getStatusMsg, hasProgress, isModal, run, setStatusMsg, taskCompleted, toString`

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

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

- ## Constructor Details

  - ### CreateDataInStructureBackgroundCmd

    public CreateDataInStructureBackgroundCmd(Address addr, int[] startPath, int length, DataType dt)
    Constructs a command for applying dataTypes within an existing structure across a range of components. Simple pointer conversion will NOT be performed.
    Parameters:
      `addr` - The address of the existing structure.
      `startPath` - the componentPath where to begin applying the datatype.
      `length` - the number of bytes to apply the data type to.
      `dt` - the datatype to be applied to the range of components.

  - ### CreateDataInStructureBackgroundCmd

    public CreateDataInStructureBackgroundCmd(Address addr, int[] startPath, int length, DataType dt, boolean stackPointers)
    This is the same as `CreateDataInStructureBackgroundCmd(Address, int[], int, DataType)` except that it allows the caller to control whether or not a pointer data type is created when a non-pointer data type is applied at a location that previously contained a pointer data type.
    Parameters:
      `addr` - The address of the existing structure.
      `startPath` - the componentPath where to begin applying the datatype.
      `length` - the number of bytes to apply the data type to.
      `dt` - the datatype to be applied to the range of components.
      `stackPointers` - True will convert the given data type to a pointer if it is not one and the previous type was a pointer; false will not make this conversion

- ## Method Details

  - ### applyTo

    public boolean applyTo(Program program, TaskMonitor monitor)
    Description copied from class: `BackgroundCommand`
    Method called when this command is to apply changes to the given domain object. A monitor is provided to display status information about the command as it executes in the background.
    Specified by:
      `applyTo` in class `BackgroundCommand<Program>`
    Parameters:
      `program` - domain object that will be affected by the command
      `monitor` - monitor to show progress of the command
    Returns:
      true if the command applied successfully
    See Also:
      - `BackgroundCommand.applyTo(ghidra.framework.model.DomainObject, ghidra.util.task.TaskMonitor)`