cmStringCommand.h 2.52 KB
Newer Older
1 2
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
Brad King's avatar
Brad King committed
3 4 5
#ifndef cmStringCommand_h
#define cmStringCommand_h

6
#include "cmConfigure.h" // IWYU pragma: keep
7

8
#include <cstddef>
9 10 11
#include <string>
#include <vector>

Brad King's avatar
Brad King committed
12 13
#include "cmCommand.h"

14
class cmExecutionStatus;
15

Brad King's avatar
Brad King committed
16 17 18 19 20 21 22 23 24 25
/** \class cmStringCommand
 * \brief Common string operations
 *
 */
class cmStringCommand : public cmCommand
{
public:
  /**
   * This is a virtual constructor for the command.
   */
26
  cmCommand* Clone() override { return new cmStringCommand; }
Brad King's avatar
Brad King committed
27 28 29 30 31

  /**
   * This is called when the command is first encountered in
   * the CMakeLists.txt file.
   */
32
  bool InitialPass(std::vector<std::string> const& args,
33
                   cmExecutionStatus& status) override;
Brad King's avatar
Brad King committed
34 35

protected:
36
  bool HandleConfigureCommand(std::vector<std::string> const& args);
37
  bool HandleAsciiCommand(std::vector<std::string> const& args);
Brad King's avatar
Brad King committed
38 39 40 41
  bool HandleRegexCommand(std::vector<std::string> const& args);
  bool RegexMatch(std::vector<std::string> const& args);
  bool RegexMatchAll(std::vector<std::string> const& args);
  bool RegexReplace(std::vector<std::string> const& args);
42
  bool HandleHashCommand(std::vector<std::string> const& args);
43 44
  bool HandleToUpperLowerCommand(std::vector<std::string> const& args,
                                 bool toUpper);
45
  bool HandleCompareCommand(std::vector<std::string> const& args);
46
  bool HandleReplaceCommand(std::vector<std::string> const& args);
47 48
  bool HandleLengthCommand(std::vector<std::string> const& args);
  bool HandleSubstringCommand(std::vector<std::string> const& args);
49
  bool HandleAppendCommand(std::vector<std::string> const& args);
50
  bool HandlePrependCommand(std::vector<std::string> const& args);
51
  bool HandleConcatCommand(std::vector<std::string> const& args);
52
  bool HandleJoinCommand(std::vector<std::string> const& args);
53
  bool HandleStripCommand(std::vector<std::string> const& args);
54
  bool HandleRepeatCommand(std::vector<std::string> const& args);
55
  bool HandleRandomCommand(std::vector<std::string> const& args);
56
  bool HandleFindCommand(std::vector<std::string> const& args);
57
  bool HandleTimestampCommand(std::vector<std::string> const& args);
58
  bool HandleMakeCIdentifierCommand(std::vector<std::string> const& args);
59
  bool HandleGenexStripCommand(std::vector<std::string> const& args);
60
  bool HandleUuidCommand(std::vector<std::string> const& args);
61

62 63
  bool joinImpl(std::vector<std::string> const& args, std::string const& glue,
                size_t varIdx);
Brad King's avatar
Brad King committed
64 65 66
};

#endif