cmCTestP4.h 1.6 KB

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