cmCTestUpdateHandler.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmCTestUpdateHandler_h
  4. #define cmCTestUpdateHandler_h
  5. #include <cmConfigure.h>
  6. #include "cmCTestGenericHandler.h"
  7. #include "cmTypeMacro.h"
  8. #include <string>
  9. #include <utility>
  10. #include <vector>
  11. /** \class cmCTestUpdateHandler
  12. * \brief A class that handles ctest -S invocations
  13. *
  14. */
  15. class cmCTestUpdateHandler : public cmCTestGenericHandler
  16. {
  17. public:
  18. typedef cmCTestGenericHandler Superclass;
  19. /*
  20. * The main entry point for this class
  21. */
  22. int ProcessHandler() CM_OVERRIDE;
  23. cmCTestUpdateHandler();
  24. enum
  25. {
  26. e_UNKNOWN = 0,
  27. e_CVS,
  28. e_SVN,
  29. e_BZR,
  30. e_GIT,
  31. e_HG,
  32. e_P4,
  33. e_LAST
  34. };
  35. /**
  36. * Initialize handler
  37. */
  38. void Initialize() CM_OVERRIDE;
  39. private:
  40. // Some structures needed for update
  41. struct StringPair : public std::pair<std::string, std::string>
  42. {
  43. };
  44. struct UpdateFiles : public std::vector<StringPair>
  45. {
  46. };
  47. // Determine the type of version control
  48. int DetermineType(const char* cmd, const char* type);
  49. // The VCS command to update the working tree.
  50. std::string UpdateCommand;
  51. int UpdateType;
  52. int DetectVCS(const char* dir);
  53. bool SelectVCS();
  54. };
  55. #endif