cmFileCommand.h 2.77 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 cmFileCommand_h
#define cmFileCommand_h

6
#include <cmConfigure.h>
7

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

11 12
#include "cmCommand.h"

13
class cmExecutionStatus;
Alexander Neundorf's avatar
 
Alexander Neundorf committed
14

15 16 17 18 19 20 21 22 23 24
/** \class cmFileCommand
 * \brief Command for manipulation of files
 *
 */
class cmFileCommand : public cmCommand
{
public:
  /**
   * This is a virtual constructor for the command.
   */
25
  cmCommand* Clone() CM_OVERRIDE { return new cmFileCommand; }
26 27 28 29 30

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

34 35 36
  /**
   * This determines if the command is invoked when in script mode.
   */
37
  bool IsScriptable() const CM_OVERRIDE { return true; }
38

39 40 41
  /**
   * The name of the command as specified in CMakeList.txt.
   */
42
  std::string GetName() const CM_OVERRIDE { return "file"; }
43 44

protected:
45
  bool HandleRename(std::vector<std::string> const& args);
46
  bool HandleRemove(std::vector<std::string> const& args, bool recurse);
47 48
  bool HandleWriteCommand(std::vector<std::string> const& args, bool append);
  bool HandleReadCommand(std::vector<std::string> const& args);
49
  bool HandleHashCommand(std::vector<std::string> const& args);
Brad King's avatar
Brad King committed
50
  bool HandleStringsCommand(std::vector<std::string> const& args);
Andy Cedilnik's avatar
Andy Cedilnik committed
51
  bool HandleGlobCommand(std::vector<std::string> const& args, bool recurse);
52
  bool HandleMakeDirectoryCommand(std::vector<std::string> const& args);
Alexander Neundorf's avatar
 
Alexander Neundorf committed
53

54
  bool HandleRelativePathCommand(std::vector<std::string> const& args);
55 56
  bool HandleCMakePathCommand(std::vector<std::string> const& args,
                              bool nativePath);
57
  bool HandleReadElfCommand(std::vector<std::string> const& args);
58 59 60
  bool HandleRPathChangeCommand(std::vector<std::string> const& args);
  bool HandleRPathCheckCommand(std::vector<std::string> const& args);
  bool HandleRPathRemoveCommand(std::vector<std::string> const& args);
61
  bool HandleDifferentCommand(std::vector<std::string> const& args);
Alexander Neundorf's avatar
 
Alexander Neundorf committed
62

63
  bool HandleCopyCommand(std::vector<std::string> const& args);
Alexander Neundorf's avatar
 
Alexander Neundorf committed
64
  bool HandleInstallCommand(std::vector<std::string> const& args);
65
  bool HandleDownloadCommand(std::vector<std::string> const& args);
David Cole's avatar
David Cole committed
66
  bool HandleUploadCommand(std::vector<std::string> const& args);
67 68

  bool HandleTimestampCommand(std::vector<std::string> const& args);
69
  bool HandleGenerateCommand(std::vector<std::string> const& args);
70
  bool HandleLockCommand(std::vector<std::string> const& args);
71 72

private:
73 74 75
  void AddEvaluationFile(const std::string& inputName,
                         const std::string& outputExpr,
                         const std::string& condition, bool inputIsContent);
76 77 78
};

#endif