Class ScriptControls

java.lang.Object
ghidra.app.script.ScriptControls

public class ScriptControls extends Object
Class to encapsulate GhidraScript control mechanisms such as stdout/stderr writers and other feedback to the user
  • Field Details

  • Constructor Details

    • ScriptControls

      public ScriptControls(PrintWriter writer, PrintWriter errorWriter, boolean decorateOutput, TaskMonitor monitor)
      Creates a new ScriptControls
      Parameters:
      writer - The target of script "print" statements (may be null)
      errorWriter - The target of script "printerr" statements (may be null)
      decorateOutput - True to decorate the writer output with a script name prefix; otherwise, false (see GhidraScript.decorate(String)
      monitor - A cancellable monitor
    • ScriptControls

      public ScriptControls(PrintWriter writer, PrintWriter errorWriter, TaskMonitor monitor)
      Creates a new ScriptControls with no decorated output
      Parameters:
      writer - The target of script "print" statements (may be null)
      errorWriter - The target of script "printerr" statements (may be null) otherwise, false (see GhidraScript.decorate(String)
      monitor - A cancellable monitor
    • ScriptControls

      public ScriptControls(OutputStream stream, OutputStream errorStream, TaskMonitor monitor)
      Creates a new ScriptControls with no decorated output
      Parameters:
      stream - The target of script "print" statements (may be null)
      errorStream - The target of script "printerr" statements (may be null) otherwise, false (see GhidraScript.decorate(String)
      monitor - A cancellable monitor
    • ScriptControls

      public ScriptControls(ConsoleService console, TaskMonitor monitor)
      Creates a new ScriptControls with no decorated output
      Parameters:
      console - The target of script "print" and "printerr" statements
      monitor - A cancellable monitor
    • ScriptControls

      public ScriptControls(ghidra.app.plugin.core.interpreter.InterpreterConsole console, TaskMonitor monitor)
      Creates a new ScriptControls with no decorated output
      Parameters:
      console - The target of script "print" and "printerr" statements
      monitor - A cancellable monitor
  • Method Details

    • getWriter

      public PrintWriter getWriter()
      Returns the target of script "print" statements (may be null).
      Returns:
      the target of script "print" statements (may be null)
    • getErrorWriter

      public PrintWriter getErrorWriter()
      Returns the target of script "printerr" statements (may be null).
      Returns:
      the target of script "printerr" statements (may be null)
    • shouldDecorateOutput

      public boolean shouldDecorateOutput()
      Returns True to decorate the writer output with a script name prefix; otherwise, false.
      Returns:
      True to decorate the writer output with a script name prefix; otherwise, false
      See Also:
    • getMonitor

      public TaskMonitor getMonitor()
      Returns A cancellable monitor.
      Returns:
      A cancellable monitor