AbstractProcessStep Class

(ProjectExplorer::AbstractProcessStep)

The AbstractProcessStep class is a convenience class that can be used as a base class instead of BuildStep. More...

Header: #include <AbstractProcessStep>
Inherits: ProjectExplorer::BuildStep

Public Functions

void appendOutputParser(IOutputParser *parser)
void emitFaultyConfigurationMessage()
bool ignoreReturnValue()
IOutputParser *outputParser() const
ProcessParameters *processParameters()
void setIgnoreReturnValue(bool b)
void setOutputParser(IOutputParser *parser)

Protected Functions

AbstractProcessStep(BuildStepList *bsl, Core::Id id)
~AbstractProcessStep() override
virtual void processFinished(int exitCode, QProcess::ExitStatus status)
virtual void processStarted()
virtual void processStartupFailed()
virtual bool processSucceeded(int exitCode, QProcess::ExitStatus status)
virtual void stdError(const QString &line)
virtual void stdOutput(const QString &line)

Reimplemented Protected Functions

virtual void doCancel() override
virtual void doRun() override
virtual bool init() override

Additional Inherited Members

Detailed Description

The AbstractProcessStep class is a convenience class that can be used as a base class instead of BuildStep.

It should be used as a base class if your buildstep just needs to run a process.

Usage:

The two functions processStarted() and processFinished() are called after starting/finishing the process. By default they add a message to the output window.

Use setEnabled() to control whether the BuildStep needs to run. (A disabled BuildStep immediately returns true, from the run function.)

See also ProjectExplorer::ProcessParameters.

Member Function Documentation

[protected] AbstractProcessStep::AbstractProcessStep(BuildStepList *bsl, Core::Id id)

Default constructs an instance of AbstractProcessStep.

[protected] AbstractProcessStep::~AbstractProcessStep()

Destroys the instance of AbstractProcessStep.

void AbstractProcessStep::appendOutputParser(IOutputParser *parser)

Appends the given output parser to the existing chain of parsers.

[override virtual protected] void AbstractProcessStep::doCancel()

[override virtual protected] void AbstractProcessStep::doRun()

Reimplemented from BuildStep::init(). You need to call this from YourBuildStep::run().

void AbstractProcessStep::emitFaultyConfigurationMessage()

bool AbstractProcessStep::ignoreReturnValue()

See also setIgnoreReturnValue().

[override virtual protected] bool AbstractProcessStep::init()

Reimplemented from BuildStep::init().

Reimplemented from BuildStep::init(). You need to call this from YourBuildStep::init().

IOutputParser *AbstractProcessStep::outputParser() const

See also setOutputParser().

[virtual protected] void AbstractProcessStep::processFinished(int exitCode, QProcess::ExitStatus status)

Called after the process is finished.

The default implementation adds a line to the output window.

ProcessParameters *AbstractProcessStep::processParameters()

Obtains a reference to the parameters for the actual process to run.

Should be used in init().

[virtual protected] void AbstractProcessStep::processStarted()

Called after the process is started.

The default implementation adds a process-started message to the output message.

[virtual protected] void AbstractProcessStep::processStartupFailed()

Called if the process could not be started.

By default, adds a message to the output window.

[virtual protected] bool AbstractProcessStep::processSucceeded(int exitCode, QProcess::ExitStatus status)

Called to test whether a process succeeded or not.

void AbstractProcessStep::setIgnoreReturnValue(bool b)

If ignoreReturnValue is set to true, then the abstractprocess step will return success even if the return value indicates otherwise.

Should be called from init.

See also ignoreReturnValue().

void AbstractProcessStep::setOutputParser(IOutputParser *parser)

Deletes all existing output parsers and starts a new chain with the given parser.

Derived classes need to call this function.

See also outputParser().

[virtual protected] void AbstractProcessStep::stdError(const QString &line)

Called for each line of output on StdErrror().

The default implementation adds the line to the application output window.

[virtual protected] void AbstractProcessStep::stdOutput(const QString &line)