cmCTestGlobalVC.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmCTestGlobalVC_h
  14. #define cmCTestGlobalVC_h
  15. #include "cmCTestVC.h"
  16. /** \class cmCTestGlobalVC
  17. * \brief Base class for handling globally-versioned trees
  18. *
  19. */
  20. class cmCTestGlobalVC: public cmCTestVC
  21. {
  22. public:
  23. /** Construct with a CTest instance and update log stream. */
  24. cmCTestGlobalVC(cmCTest* ctest, std::ostream& log);
  25. virtual ~cmCTestGlobalVC();
  26. protected:
  27. // Implement cmCTestVC internal API.
  28. virtual bool WriteXMLUpdates(std::ostream& xml);
  29. /** Represent a vcs-reported action for one path in a revision. */
  30. struct Change
  31. {
  32. char Action;
  33. std::string Path;
  34. Change(char a = '?'): Action(a) {}
  35. };
  36. // Update status for files in each directory.
  37. class Directory: public std::map<cmStdString, File> {};
  38. std::map<cmStdString, Directory> Dirs;
  39. // Old and new repository revisions.
  40. std::string OldRevision;
  41. std::string NewRevision;
  42. // Information known about old revision.
  43. Revision PriorRev;
  44. // Information about revisions from a svn log.
  45. std::list<Revision> Revisions;
  46. virtual const char* LocalPath(std::string const& path);
  47. virtual void DoRevision(Revision const& revision,
  48. std::vector<Change> const& changes);
  49. virtual void DoModification(PathStatus status, std::string const& path);
  50. virtual void LoadModifications() = 0;
  51. virtual void LoadRevisions() = 0;
  52. void WriteXMLDirectory(std::ostream& xml, std::string const& path,
  53. Directory const& dir);
  54. };
  55. #endif