cmake/Source/cmExecutionStatus.h

50 lines
1.4 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2020-02-01 23:06:01 +01:00
#include <cmConfigure.h> // IWYU pragma: keep
#include <string>
class cmMakefile;
/** \class cmExecutionStatus
* \brief Superclass for all command status classes
*
* when a command is involked it may set values on a command status instance
*/
2015-08-17 11:37:30 +02:00
class cmExecutionStatus
{
public:
2020-02-01 23:06:01 +01:00
cmExecutionStatus(cmMakefile& makefile)
: Makefile(makefile)
, Error("unknown error.")
2016-07-09 11:21:54 +02:00
{
}
2017-07-20 19:35:53 +02:00
2020-02-01 23:06:01 +01:00
cmMakefile& GetMakefile() { return this->Makefile; }
void SetError(std::string const& e) { this->Error = e; }
std::string const& GetError() const { return this->Error; }
2017-07-20 19:35:53 +02:00
void SetReturnInvoked() { this->ReturnInvoked = true; }
bool GetReturnInvoked() const { return this->ReturnInvoked; }
void SetBreakInvoked() { this->BreakInvoked = true; }
bool GetBreakInvoked() const { return this->BreakInvoked; }
void SetContinueInvoked() { this->ContinueInvoked = true; }
bool GetContinueInvoked() const { return this->ContinueInvoked; }
void SetNestedError() { this->NestedError = true; }
bool GetNestedError() const { return this->NestedError; }
2013-03-16 19:13:01 +02:00
2015-08-17 11:37:30 +02:00
private:
2020-02-01 23:06:01 +01:00
cmMakefile& Makefile;
std::string Error;
2019-11-11 23:01:05 +01:00
bool ReturnInvoked = false;
bool BreakInvoked = false;
bool ContinueInvoked = false;
bool NestedError = false;
};