1
0

cmCTestUpdateHandler.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmCTestUpdateHandler_h
  14. #define cmCTestUpdateHandler_h
  15. #include "cmCTestGenericHandler.h"
  16. #include "cmListFileCache.h"
  17. #if defined(__sgi) && !defined(__GNUC__)
  18. # pragma set woff 1375 /* base class destructor not virtual */
  19. #endif
  20. /** \class cmCTestUpdateHandler
  21. * \brief A class that handles ctest -S invocations
  22. *
  23. */
  24. class cmCTestUpdateHandler : public cmCTestGenericHandler
  25. {
  26. public:
  27. cmTypeMacro(cmCTestUpdateHandler, cmCTestGenericHandler);
  28. /*
  29. * The main entry point for this class
  30. */
  31. int ProcessHandler();
  32. cmCTestUpdateHandler();
  33. enum {
  34. e_UNKNOWN = 0,
  35. e_CVS,
  36. e_SVN,
  37. e_BZR,
  38. e_GIT,
  39. e_HG,
  40. e_LAST
  41. };
  42. /**
  43. * Initialize handler
  44. */
  45. virtual void Initialize();
  46. private:
  47. // Some structures needed for update
  48. struct StringPair :
  49. public std::pair<std::string, std::string>{};
  50. struct UpdateFiles : public std::vector<StringPair>{};
  51. // Determine the type of version control
  52. int DetermineType(const char* cmd, const char* type);
  53. // The VCS command to update the working tree.
  54. std::string UpdateCommand;
  55. int UpdateType;
  56. bool InitialCheckout(std::ostream& ofs);
  57. int DetectVCS(const char* dir);
  58. bool SelectVCS();
  59. };
  60. #if defined(__sgi) && !defined(__GNUC__)
  61. # pragma reset woff 1375 /* base class destructor not virtual */
  62. #endif
  63. #endif