cmDisallowedCommand.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. bool IsScriptable() const CM_OVERRIDE
  30. {
  31. return this->Command->IsScriptable();
  32. }
  33. std::string GetName() const CM_OVERRIDE { return this->Command->GetName(); }
  34. private:
  35. cmCommand* Command;
  36. cmPolicies::PolicyID Policy;
  37. const char* Message;
  38. };
  39. #endif