Package org.eclipse.cdt.core
Interface ICommandLauncher
-
- All Known Implementing Classes:
CommandLauncher
public interface ICommandLauncherAn interface for launchers of external commands.- Since:
- 5.1
-
-
Field Summary
Fields Modifier and Type Field Description static intCOMMAND_CANCELEDstatic intILLEGAL_COMMANDstatic intOK
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Processexecute(org.eclipse.core.runtime.IPath commandPath, String[] args, String[] env, org.eclipse.core.runtime.IPath workingDirectory, org.eclipse.core.runtime.IProgressMonitor monitor)Execute a commandString[]getCommandArgs()Returns an array of the command line arguments that were last used to execute a command.StringgetCommandLine()Returns the constructed command line of the last command executed.PropertiesgetEnvironment()Returns the set of environment variables in the context of which this launcher will execute commands.StringgetErrorMessage()Returns a human readable error message corresponding to the last error encountered during command execution.org.eclipse.core.resources.IProjectgetProject()Gets the project this launcher is associated with.voidsetErrorMessage(String error)Sets the human readable error message corresponding to the last error encountered during command execution.voidsetProject(org.eclipse.core.resources.IProject project)Sets the project that this launcher is associated with, ornullif there is no such project.voidshowCommand(boolean show)Sets if the command should be printed out first before executing.intwaitAndRead(OutputStream out, OutputStream err)Deprecated.intwaitAndRead(OutputStream output, OutputStream err, org.eclipse.core.runtime.IProgressMonitor monitor)Reads output form the process to the streams.
-
-
-
Field Detail
-
COMMAND_CANCELED
static final int COMMAND_CANCELED
- See Also:
- Constant Field Values
-
ILLEGAL_COMMAND
static final int ILLEGAL_COMMAND
- See Also:
- Constant Field Values
-
OK
static final int OK
- See Also:
- Constant Field Values
-
-
Method Detail
-
setProject
void setProject(org.eclipse.core.resources.IProject project)
Sets the project that this launcher is associated with, ornullif there is no such project.- Parameters:
project-
-
getProject
org.eclipse.core.resources.IProject getProject()
Gets the project this launcher is associated with.- Returns:
- IProject, or
nullif there is no such project.
-
showCommand
void showCommand(boolean show)
Sets if the command should be printed out first before executing.
-
getErrorMessage
String getErrorMessage()
Returns a human readable error message corresponding to the last error encountered during command execution.- Returns:
- A String corresponding to the error, or
nullif there has been no error. The message could be multi-line, however it is NOT guaranteed that it ends with end of line.
-
setErrorMessage
void setErrorMessage(String error)
Sets the human readable error message corresponding to the last error encountered during command execution. A subsequent call to getErrorMessage() will return this string.- Parameters:
error- A String corresponding to the error message, ornullif the error state is intended to be cleared.
-
getCommandArgs
String[] getCommandArgs()
Returns an array of the command line arguments that were last used to execute a command.- Returns:
- an array of type String[] corresponding to the arguments. The array can be empty, but should not be null.
-
getEnvironment
Properties getEnvironment()
Returns the set of environment variables in the context of which this launcher will execute commands.- Returns:
- Properties
-
getCommandLine
String getCommandLine()
Returns the constructed command line of the last command executed.- Returns:
- String
-
execute
Process execute(org.eclipse.core.runtime.IPath commandPath, String[] args, String[] env, org.eclipse.core.runtime.IPath workingDirectory, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
Execute a command- Parameters:
env- The list of environment variables in variable=value format.- Throws:
org.eclipse.core.runtime.CoreException- if there is an error executing the command.
-
waitAndRead
@Deprecated int waitAndRead(OutputStream out, OutputStream err)
Deprecated.- Restriction:
- This method is not intended to be referenced by clients.
-
waitAndRead
int waitAndRead(OutputStream output, OutputStream err, org.eclipse.core.runtime.IProgressMonitor monitor)
Reads output form the process to the streams. A progress monitor is polled to test if the cancel button has been pressed. Destroys the process if the monitor becomes canceled override to implement a different way to read the process inputs
-
-