cmCTestP4.h 1.6 KB

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