cmStringCommand.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 cmStringCommand_h
  4. #define cmStringCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <cstddef>
  7. #include <string>
  8. #include <vector>
  9. #include "cmCommand.h"
  10. class cmExecutionStatus;
  11. /** \class cmStringCommand
  12. * \brief Common string operations
  13. *
  14. */
  15. class cmStringCommand : public cmCommand
  16. {
  17. public:
  18. /**
  19. * This is a virtual constructor for the command.
  20. */
  21. cmCommand* Clone() override { return new cmStringCommand; }
  22. /**
  23. * This is called when the command is first encountered in
  24. * the CMakeLists.txt file.
  25. */
  26. bool InitialPass(std::vector<std::string> const& args,
  27. cmExecutionStatus& status) override;
  28. protected:
  29. bool HandleConfigureCommand(std::vector<std::string> const& args);
  30. bool HandleAsciiCommand(std::vector<std::string> const& args);
  31. bool HandleRegexCommand(std::vector<std::string> const& args);
  32. bool RegexMatch(std::vector<std::string> const& args);
  33. bool RegexMatchAll(std::vector<std::string> const& args);
  34. bool RegexReplace(std::vector<std::string> const& args);
  35. bool HandleHashCommand(std::vector<std::string> const& args);
  36. bool HandleToUpperLowerCommand(std::vector<std::string> const& args,
  37. bool toUpper);
  38. bool HandleCompareCommand(std::vector<std::string> const& args);
  39. bool HandleReplaceCommand(std::vector<std::string> const& args);
  40. bool HandleLengthCommand(std::vector<std::string> const& args);
  41. bool HandleSubstringCommand(std::vector<std::string> const& args);
  42. bool HandleAppendCommand(std::vector<std::string> const& args);
  43. bool HandlePrependCommand(std::vector<std::string> const& args);
  44. bool HandleConcatCommand(std::vector<std::string> const& args);
  45. bool HandleJoinCommand(std::vector<std::string> const& args);
  46. bool HandleStripCommand(std::vector<std::string> const& args);
  47. bool HandleRandomCommand(std::vector<std::string> const& args);
  48. bool HandleFindCommand(std::vector<std::string> const& args);
  49. bool HandleTimestampCommand(std::vector<std::string> const& args);
  50. bool HandleMakeCIdentifierCommand(std::vector<std::string> const& args);
  51. bool HandleGenexStripCommand(std::vector<std::string> const& args);
  52. bool HandleUuidCommand(std::vector<std::string> const& args);
  53. bool joinImpl(std::vector<std::string> const& args, std::string const& glue,
  54. size_t varIdx);
  55. };
  56. #endif