cmCTestUpdateHandler.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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_P4,
  38. e_LAST
  39. };
  40. /**
  41. * Initialize handler
  42. */
  43. virtual void Initialize();
  44. private:
  45. // Some structures needed for update
  46. struct StringPair :
  47. public std::pair<std::string, std::string>{};
  48. struct UpdateFiles : public std::vector<StringPair>{};
  49. // Determine the type of version control
  50. int DetermineType(const char* cmd, const char* type);
  51. // The VCS command to update the working tree.
  52. std::string UpdateCommand;
  53. int UpdateType;
  54. int DetectVCS(const char* dir);
  55. bool SelectVCS();
  56. };
  57. #if defined(__sgi) && !defined(__GNUC__)
  58. # pragma reset woff 1375 /* base class destructor not virtual */
  59. #endif
  60. #endif