cmFileCommand.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmFileCommand_h
  11. #define cmFileCommand_h
  12. #include "cmCommand.h"
  13. struct cmFileInstaller;
  14. /** \class cmFileCommand
  15. * \brief Command for manipulation of files
  16. *
  17. */
  18. class cmFileCommand : public cmCommand
  19. {
  20. public:
  21. /**
  22. * This is a virtual constructor for the command.
  23. */
  24. virtual cmCommand* Clone()
  25. {
  26. return new cmFileCommand;
  27. }
  28. /**
  29. * This is called when the command is first encountered in
  30. * the CMakeLists.txt file.
  31. */
  32. virtual bool InitialPass(std::vector<std::string> const& args,
  33. cmExecutionStatus &status);
  34. /**
  35. * This determines if the command is invoked when in script mode.
  36. */
  37. virtual bool IsScriptable() const { return true; }
  38. /**
  39. * The name of the command as specified in CMakeList.txt.
  40. */
  41. virtual const char* GetName() const { return "file";}
  42. cmTypeMacro(cmFileCommand, cmCommand);
  43. protected:
  44. bool HandleRename(std::vector<std::string> const& args);
  45. bool HandleRemove(std::vector<std::string> const& args, bool recurse);
  46. bool HandleWriteCommand(std::vector<std::string> const& args, bool append);
  47. bool HandleReadCommand(std::vector<std::string> const& args);
  48. bool HandleHashCommand(std::vector<std::string> const& args);
  49. bool HandleStringsCommand(std::vector<std::string> const& args);
  50. bool HandleGlobCommand(std::vector<std::string> const& args, bool recurse);
  51. bool HandleMakeDirectoryCommand(std::vector<std::string> const& args);
  52. bool HandleRelativePathCommand(std::vector<std::string> const& args);
  53. bool HandleCMakePathCommand(std::vector<std::string> const& args,
  54. bool nativePath);
  55. bool HandleRPathChangeCommand(std::vector<std::string> const& args);
  56. bool HandleRPathCheckCommand(std::vector<std::string> const& args);
  57. bool HandleRPathRemoveCommand(std::vector<std::string> const& args);
  58. bool HandleDifferentCommand(std::vector<std::string> const& args);
  59. bool HandleCopyCommand(std::vector<std::string> const& args);
  60. bool HandleInstallCommand(std::vector<std::string> const& args);
  61. bool HandleDownloadCommand(std::vector<std::string> const& args);
  62. bool HandleUploadCommand(std::vector<std::string> const& args);
  63. bool HandleTimestampCommand(std::vector<std::string> const& args);
  64. bool HandleGenerateCommand(std::vector<std::string> const& args);
  65. private:
  66. void AddEvaluationFile(const std::string &inputName,
  67. const std::string &outputExpr,
  68. const std::string &condition,
  69. bool inputIsContent);
  70. };
  71. #endif