cmCTestGlobalVC.h 2.0 KB

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