cmCTestP4.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2013 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 cmCTestP4_h
  11. #define cmCTestP4_h
  12. #include "cmCTestGlobalVC.h"
  13. #include <map>
  14. #include <vector>
  15. /** \class cmCTestP4
  16. * \brief Interaction with the Perforce command-line tool
  17. *
  18. */
  19. class cmCTestP4 : public cmCTestGlobalVC
  20. {
  21. public:
  22. /** Construct with a CTest instance and update log stream. */
  23. cmCTestP4(cmCTest* ctest, std::ostream& log);
  24. ~cmCTestP4() CM_OVERRIDE;
  25. private:
  26. std::vector<std::string> ChangeLists;
  27. struct User
  28. {
  29. std::string UserName;
  30. std::string Name;
  31. std::string EMail;
  32. std::string AccessTime;
  33. User()
  34. : UserName()
  35. , Name()
  36. , EMail()
  37. , AccessTime()
  38. {
  39. }
  40. };
  41. std::map<std::string, User> Users;
  42. std::vector<std::string> P4Options;
  43. User GetUserData(const std::string& username);
  44. void SetP4Options(std::vector<char const*>& options);
  45. std::string GetWorkingRevision();
  46. void NoteOldRevision() CM_OVERRIDE;
  47. void NoteNewRevision() CM_OVERRIDE;
  48. bool UpdateImpl() CM_OVERRIDE;
  49. bool UpdateCustom(const std::string& custom);
  50. void LoadRevisions() CM_OVERRIDE;
  51. void LoadModifications() CM_OVERRIDE;
  52. // Parsing helper classes.
  53. class IdentifyParser;
  54. class ChangesParser;
  55. class UserParser;
  56. class DescribeParser;
  57. class DiffParser;
  58. friend class IdentifyParser;
  59. friend class ChangesParser;
  60. friend class UserParser;
  61. friend class DescribeParser;
  62. friend class DiffParser;
  63. };
  64. #endif