2016-10-30 18:24:19 +01:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2008-10-12 18:41:06 +02:00
|
|
|
#ifndef cmStringCommand_h
|
|
|
|
#define cmStringCommand_h
|
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2017-07-20 19:35:53 +02:00
|
|
|
|
2018-08-09 18:06:22 +02:00
|
|
|
#include <cstddef>
|
2017-04-14 19:02:05 +02:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2008-10-12 18:41:06 +02:00
|
|
|
#include "cmCommand.h"
|
|
|
|
|
2017-04-14 19:02:05 +02:00
|
|
|
class cmExecutionStatus;
|
2008-10-12 18:41:06 +02:00
|
|
|
|
|
|
|
/** \class cmStringCommand
|
|
|
|
* \brief Common string operations
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class cmStringCommand : public cmCommand
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* This is a virtual constructor for the command.
|
|
|
|
*/
|
2018-01-26 17:06:56 +01:00
|
|
|
cmCommand* Clone() override { return new cmStringCommand; }
|
2008-10-12 18:41:06 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is called when the command is first encountered in
|
|
|
|
* the CMakeLists.txt file.
|
|
|
|
*/
|
2016-10-30 18:24:19 +01:00
|
|
|
bool InitialPass(std::vector<std::string> const& args,
|
2018-01-26 17:06:56 +01:00
|
|
|
cmExecutionStatus& status) override;
|
2008-10-12 18:41:06 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool HandleConfigureCommand(std::vector<std::string> const& args);
|
|
|
|
bool HandleAsciiCommand(std::vector<std::string> const& args);
|
|
|
|
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);
|
2012-02-18 12:40:36 +02:00
|
|
|
bool HandleHashCommand(std::vector<std::string> const& args);
|
2008-10-12 18:41:06 +02:00
|
|
|
bool HandleToUpperLowerCommand(std::vector<std::string> const& args,
|
|
|
|
bool toUpper);
|
|
|
|
bool HandleCompareCommand(std::vector<std::string> const& args);
|
|
|
|
bool HandleReplaceCommand(std::vector<std::string> const& args);
|
|
|
|
bool HandleLengthCommand(std::vector<std::string> const& args);
|
|
|
|
bool HandleSubstringCommand(std::vector<std::string> const& args);
|
2015-11-17 17:22:37 +01:00
|
|
|
bool HandleAppendCommand(std::vector<std::string> const& args);
|
2018-01-26 17:06:56 +01:00
|
|
|
bool HandlePrependCommand(std::vector<std::string> const& args);
|
2014-08-03 19:52:23 +02:00
|
|
|
bool HandleConcatCommand(std::vector<std::string> const& args);
|
2018-08-09 18:06:22 +02:00
|
|
|
bool HandleJoinCommand(std::vector<std::string> const& args);
|
2008-10-12 18:41:06 +02:00
|
|
|
bool HandleStripCommand(std::vector<std::string> const& args);
|
|
|
|
bool HandleRandomCommand(std::vector<std::string> const& args);
|
2011-06-19 15:41:06 +03:00
|
|
|
bool HandleFindCommand(std::vector<std::string> const& args);
|
2013-03-16 19:13:01 +02:00
|
|
|
bool HandleTimestampCommand(std::vector<std::string> const& args);
|
2013-11-03 12:27:13 +02:00
|
|
|
bool HandleMakeCIdentifierCommand(std::vector<std::string> const& args);
|
2015-04-27 22:25:09 +02:00
|
|
|
bool HandleGenexStripCommand(std::vector<std::string> const& args);
|
|
|
|
bool HandleUuidCommand(std::vector<std::string> const& args);
|
2008-10-12 18:41:06 +02:00
|
|
|
|
2018-08-09 18:06:22 +02:00
|
|
|
bool joinImpl(std::vector<std::string> const& args, std::string const& glue,
|
|
|
|
size_t varIdx);
|
2008-10-12 18:41:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|