cmDisallowedCommand.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmDisallowedCommand_h
  4. #define cmDisallowedCommand_h
  5. #include "cmConfigure.h"
  6. #include <string>
  7. #include <vector>
  8. #include "cmCommand.h"
  9. #include "cmPolicies.h"
  10. class cmExecutionStatus;
  11. class cmDisallowedCommand : public cmCommand
  12. {
  13. public:
  14. cmDisallowedCommand(cmCommand* command, cmPolicies::PolicyID policy,
  15. const char* message)
  16. : Command(command)
  17. , Policy(policy)
  18. , Message(message)
  19. {
  20. }
  21. ~cmDisallowedCommand() CM_OVERRIDE { delete this->Command; }
  22. cmCommand* Clone() CM_OVERRIDE
  23. {
  24. return new cmDisallowedCommand(this->Command->Clone(), this->Policy,
  25. this->Message);
  26. }
  27. bool InitialPass(std::vector<std::string> const& args,
  28. cmExecutionStatus& status) CM_OVERRIDE;
  29. void FinalPass() CM_OVERRIDE { this->Command->FinalPass(); }
  30. bool HasFinalPass() const CM_OVERRIDE
  31. {
  32. return this->Command->HasFinalPass();
  33. }
  34. std::string GetName() const CM_OVERRIDE { return this->Command->GetName(); }
  35. private:
  36. cmCommand* Command;
  37. cmPolicies::PolicyID Policy;
  38. const char* Message;
  39. };
  40. #endif