cmake/Source/cmDisallowedCommand.h

49 lines
1.2 KiB
C
Raw Normal View History

2017-07-20 19:35:53 +02:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef cmDisallowedCommand_h
#define cmDisallowedCommand_h
2018-01-26 17:06:56 +01:00
#include "cmConfigure.h" // IWYU pragma: keep
2017-07-20 19:35:53 +02:00
#include <string>
#include <vector>
#include "cmCommand.h"
#include "cmPolicies.h"
class cmExecutionStatus;
class cmDisallowedCommand : public cmCommand
{
public:
cmDisallowedCommand(cmCommand* command, cmPolicies::PolicyID policy,
const char* message)
: Command(command)
, Policy(policy)
, Message(message)
{
}
2018-01-26 17:06:56 +01:00
~cmDisallowedCommand() override { delete this->Command; }
2017-07-20 19:35:53 +02:00
2018-01-26 17:06:56 +01:00
cmCommand* Clone() override
2017-07-20 19:35:53 +02:00
{
return new cmDisallowedCommand(this->Command->Clone(), this->Policy,
this->Message);
}
bool InitialPass(std::vector<std::string> const& args,
2018-01-26 17:06:56 +01:00
cmExecutionStatus& status) override;
2017-07-20 19:35:53 +02:00
2018-01-26 17:06:56 +01:00
void FinalPass() override { this->Command->FinalPass(); }
2017-07-20 19:35:53 +02:00
2018-01-26 17:06:56 +01:00
bool HasFinalPass() const override { return this->Command->HasFinalPass(); }
2017-07-20 19:35:53 +02:00
private:
cmCommand* Command;
cmPolicies::PolicyID Policy;
const char* Message;
};
#endif