cmCTestGlobalVC.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. /** Represent a vcs-reported action for one path in a revision. */
  28. struct Change
  29. {
  30. char Action;
  31. std::string Path;
  32. Change(char a = '?')
  33. : Action(a)
  34. {
  35. }
  36. };
  37. // Update status for files in each directory.
  38. class Directory : public std::map<std::string, File>
  39. {
  40. };
  41. std::map<std::string, Directory> Dirs;
  42. // Old and new repository revisions.
  43. std::string OldRevision;
  44. std::string NewRevision;
  45. // Information known about old revision.
  46. Revision PriorRev;
  47. // Information about revisions from a svn log.
  48. std::list<Revision> Revisions;
  49. virtual const char* LocalPath(std::string const& path);
  50. virtual void DoRevision(Revision const& revision,
  51. std::vector<Change> const& changes);
  52. virtual void DoModification(PathStatus status, std::string const& path);
  53. virtual bool LoadModifications() = 0;
  54. virtual bool LoadRevisions() = 0;
  55. virtual void WriteXMLGlobal(cmXMLWriter& xml);
  56. void WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
  57. Directory const& dir);
  58. };
  59. #endif