cmCTestUpdateHandler.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc.
  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 cmCTestUpdateHandler_h
  11. #define cmCTestUpdateHandler_h
  12. #include "cmCTestGenericHandler.h"
  13. #include "cmListFileCache.h"
  14. #if defined(__sgi) && !defined(__GNUC__)
  15. # pragma set woff 1375 /* base class destructor not virtual */
  16. #endif
  17. /** \class cmCTestUpdateHandler
  18. * \brief A class that handles ctest -S invocations
  19. *
  20. */
  21. class cmCTestUpdateHandler : public cmCTestGenericHandler
  22. {
  23. public:
  24. cmTypeMacro(cmCTestUpdateHandler, cmCTestGenericHandler);
  25. /*
  26. * The main entry point for this class
  27. */
  28. int ProcessHandler();
  29. cmCTestUpdateHandler();
  30. enum {
  31. e_UNKNOWN = 0,
  32. e_CVS,
  33. e_SVN,
  34. e_BZR,
  35. e_GIT,
  36. e_HG,
  37. e_LAST
  38. };
  39. /**
  40. * Initialize handler
  41. */
  42. virtual void Initialize();
  43. private:
  44. // Some structures needed for update
  45. struct StringPair :
  46. public std::pair<std::string, std::string>{};
  47. struct UpdateFiles : public std::vector<StringPair>{};
  48. // Determine the type of version control
  49. int DetermineType(const char* cmd, const char* type);
  50. // The VCS command to update the working tree.
  51. std::string UpdateCommand;
  52. int UpdateType;
  53. int DetectVCS(const char* dir);
  54. bool SelectVCS();
  55. };
  56. #if defined(__sgi) && !defined(__GNUC__)
  57. # pragma reset woff 1375 /* base class destructor not virtual */
  58. #endif
  59. #endif