cmCTestP4.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 <vector>
  14. #include <map>
  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. virtual ~cmCTestP4();
  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(): UserName(), Name(), EMail(), AccessTime() {}
  34. };
  35. std::map<std::string, User> Users;
  36. std::vector<std::string> P4Options;
  37. User GetUserData(const std::string& username);
  38. void SetP4Options(std::vector<char const*> &options);
  39. std::string GetWorkingRevision();
  40. virtual void NoteOldRevision();
  41. virtual void NoteNewRevision();
  42. virtual bool UpdateImpl();
  43. bool UpdateCustom(const std::string& custom);
  44. void LoadRevisions();
  45. void LoadModifications();
  46. // Parsing helper classes.
  47. class IdentifyParser;
  48. class ChangesParser;
  49. class UserParser;
  50. class DescribeParser;
  51. class DiffParser;
  52. friend class IdentifyParser;
  53. friend class ChangesParser;
  54. friend class UserParser;
  55. friend class DescribeParser;
  56. friend class DiffParser;
  57. };
  58. #endif