2016-09-27 19:01:08 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2006-02-10 19:11:12 +00:00
|
|
|
#ifndef cmListCommand_h
|
|
|
|
#define cmListCommand_h
|
|
|
|
|
2016-10-25 18:35:04 +00:00
|
|
|
#include <cmConfigure.h>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2006-02-10 19:11:12 +00:00
|
|
|
#include "cmCommand.h"
|
|
|
|
|
2016-10-25 18:35:04 +00:00
|
|
|
class cmExecutionStatus;
|
|
|
|
|
2006-02-10 19:11:12 +00:00
|
|
|
/** \class cmListCommand
|
|
|
|
* \brief Common list operations
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class cmListCommand : public cmCommand
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* This is a virtual constructor for the command.
|
|
|
|
*/
|
2016-06-27 19:25:27 +00:00
|
|
|
cmCommand* Clone() CM_OVERRIDE { return new cmListCommand; }
|
2006-02-10 19:11:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is called when the command is first encountered in
|
|
|
|
* the CMakeLists.txt file.
|
|
|
|
*/
|
2016-06-27 19:25:27 +00:00
|
|
|
bool InitialPass(std::vector<std::string> const& args,
|
|
|
|
cmExecutionStatus& status) CM_OVERRIDE;
|
2006-02-10 19:11:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This determines if the command is invoked when in script mode.
|
|
|
|
*/
|
2016-06-27 19:25:27 +00:00
|
|
|
bool IsScriptable() const CM_OVERRIDE { return true; }
|
2006-02-10 19:11:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of the command as specified in CMakeList.txt.
|
|
|
|
*/
|
2016-06-27 19:25:27 +00:00
|
|
|
std::string GetName() const CM_OVERRIDE { return "list"; }
|
2006-02-10 19:11:12 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool HandleLengthCommand(std::vector<std::string> const& args);
|
|
|
|
bool HandleGetCommand(std::vector<std::string> const& args);
|
2006-05-15 13:25:06 +00:00
|
|
|
bool HandleAppendCommand(std::vector<std::string> const& args);
|
2007-08-15 14:26:50 +00:00
|
|
|
bool HandleFindCommand(std::vector<std::string> const& args);
|
2006-02-10 19:11:12 +00:00
|
|
|
bool HandleInsertCommand(std::vector<std::string> const& args);
|
2006-05-15 13:57:49 +00:00
|
|
|
bool HandleRemoveAtCommand(std::vector<std::string> const& args);
|
2006-02-10 19:11:12 +00:00
|
|
|
bool HandleRemoveItemCommand(std::vector<std::string> const& args);
|
2008-03-12 21:02:10 +00:00
|
|
|
bool HandleRemoveDuplicatesCommand(std::vector<std::string> const& args);
|
2006-08-22 14:16:46 +00:00
|
|
|
bool HandleSortCommand(std::vector<std::string> const& args);
|
|
|
|
bool HandleReverseCommand(std::vector<std::string> const& args);
|
2016-01-28 21:29:10 +00:00
|
|
|
bool HandleFilterCommand(std::vector<std::string> const& args);
|
2016-05-16 14:34:04 +00:00
|
|
|
bool FilterRegex(std::vector<std::string> const& args, bool includeMatches,
|
|
|
|
std::string const& listName,
|
|
|
|
std::vector<std::string>& varArgsExpanded);
|
2006-02-10 19:11:12 +00:00
|
|
|
|
2014-02-04 21:06:56 +00:00
|
|
|
bool GetList(std::vector<std::string>& list, const std::string& var);
|
|
|
|
bool GetListString(std::string& listString, const std::string& var);
|
2006-02-10 19:11:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|