cmListCommand.h 2.23 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.  */
3 4 5
#ifndef cmListCommand_h
#define cmListCommand_h

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

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

11 12
#include "cmCommand.h"

13 14
class cmExecutionStatus;

15 16 17 18 19 20 21 22 23 24
/** \class cmListCommand
 * \brief Common list operations
 *
 */
class cmListCommand : public cmCommand
{
public:
  /**
   * This is a virtual constructor for the command.
   */
25
  cmCommand* Clone() override { return new cmListCommand; }
26 27 28 29 30

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

protected:
  bool HandleLengthCommand(std::vector<std::string> const& args);
  bool HandleGetCommand(std::vector<std::string> const& args);
37
  bool HandleAppendCommand(std::vector<std::string> const& args);
38 39 40
  bool HandlePrependCommand(std::vector<std::string> const& args);
  bool HandlePopBackCommand(std::vector<std::string> const& args);
  bool HandlePopFrontCommand(std::vector<std::string> const& args);
41
  bool HandleFindCommand(std::vector<std::string> const& args);
42
  bool HandleInsertCommand(std::vector<std::string> const& args);
43
  bool HandleJoinCommand(std::vector<std::string> const& args);
44
  bool HandleRemoveAtCommand(std::vector<std::string> const& args);
45
  bool HandleRemoveItemCommand(std::vector<std::string> const& args);
46
  bool HandleRemoveDuplicatesCommand(std::vector<std::string> const& args);
47
  bool HandleTransformCommand(std::vector<std::string> const& args);
Andy Cedilnik's avatar
Andy Cedilnik committed
48
  bool HandleSortCommand(std::vector<std::string> const& args);
49
  bool HandleSublistCommand(std::vector<std::string> const& args);
Andy Cedilnik's avatar
Andy Cedilnik committed
50
  bool HandleReverseCommand(std::vector<std::string> const& args);
51
  bool HandleFilterCommand(std::vector<std::string> const& args);
52 53 54
  bool FilterRegex(std::vector<std::string> const& args, bool includeMatches,
                   std::string const& listName,
                   std::vector<std::string>& varArgsExpanded);
55

56 57
  bool GetList(std::vector<std::string>& list, const std::string& var);
  bool GetListString(std::string& listString, const std::string& var);
58 59 60
};

#endif