cmCTestGlobalVC.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 cmCTestGlobalVC_h
  4. #define cmCTestGlobalVC_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include "cmCTestVC.h"
  7. #include <iosfwd>
  8. #include <list>
  9. #include <map>
  10. #include <string>
  11. #include <vector>
  12. class cmCTest;
  13. class cmXMLWriter;
  14. /** \class cmCTestGlobalVC
  15. * \brief Base class for handling globally-versioned trees
  16. *
  17. */
  18. class cmCTestGlobalVC : public cmCTestVC
  19. {
  20. public:
  21. /** Construct with a CTest instance and update log stream. */
  22. cmCTestGlobalVC(cmCTest* ctest, std::ostream& log);
  23. ~cmCTestGlobalVC() override;
  24. protected:
  25. // Implement cmCTestVC internal API.
  26. bool WriteXMLUpdates(cmXMLWriter& xml) override;
  27. void SetNewRevision(std::string const& revision) override;
  28. /** Represent a vcs-reported action for one path in a revision. */
  29. struct Change
  30. {
  31. char Action;
  32. std::string Path;
  33. Change(char a = '?')
  34. : Action(a)
  35. {
  36. }
  37. };
  38. // Update status for files in each directory.
  39. class Directory : public std::map<std::string, File>
  40. {
  41. };
  42. std::map<std::string, Directory> Dirs;
  43. // Old and new repository revisions.
  44. std::string OldRevision;
  45. std::string NewRevision;
  46. // Information known about old revision.
  47. Revision PriorRev;
  48. // Information about revisions from a svn log.
  49. std::list<Revision> Revisions;
  50. virtual const char* LocalPath(std::string const& path);
  51. virtual void DoRevision(Revision const& revision,
  52. std::vector<Change> const& changes);
  53. virtual void DoModification(PathStatus status, std::string const& path);
  54. virtual bool LoadModifications() = 0;
  55. virtual bool LoadRevisions() = 0;
  56. virtual void WriteXMLGlobal(cmXMLWriter& xml);
  57. void WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
  58. Directory const& dir);
  59. };
  60. #endif