cmake/Source/CTest/cmCTestGlobalVC.h

76 lines
1.8 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2009-10-04 10:30:41 +03:00
#ifndef cmCTestGlobalVC_h
#define cmCTestGlobalVC_h
2018-01-26 17:06:56 +01:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
2009-10-04 10:30:41 +03:00
#include "cmCTestVC.h"
2016-10-30 18:24:19 +01:00
#include <iosfwd>
2015-08-17 11:37:30 +02:00
#include <list>
2016-10-30 18:24:19 +01:00
#include <map>
#include <string>
#include <vector>
class cmCTest;
class cmXMLWriter;
2015-08-17 11:37:30 +02:00
2009-10-04 10:30:41 +03:00
/** \class cmCTestGlobalVC
* \brief Base class for handling globally-versioned trees
*
*/
2016-07-09 11:21:54 +02:00
class cmCTestGlobalVC : public cmCTestVC
2009-10-04 10:30:41 +03:00
{
public:
/** Construct with a CTest instance and update log stream. */
cmCTestGlobalVC(cmCTest* ctest, std::ostream& log);
2018-01-26 17:06:56 +01:00
~cmCTestGlobalVC() override;
2009-10-04 10:30:41 +03:00
protected:
// Implement cmCTestVC internal API.
2018-01-26 17:06:56 +01:00
bool WriteXMLUpdates(cmXMLWriter& xml) override;
2009-10-04 10:30:41 +03:00
/** Represent a vcs-reported action for one path in a revision. */
struct Change
{
char Action;
std::string Path;
2016-07-09 11:21:54 +02:00
Change(char a = '?')
: Action(a)
{
}
2009-10-04 10:30:41 +03:00
};
// Update status for files in each directory.
2016-07-09 11:21:54 +02:00
class Directory : public std::map<std::string, File>
{
};
2015-04-27 22:25:09 +02:00
std::map<std::string, Directory> Dirs;
2009-10-04 10:30:41 +03:00
// Old and new repository revisions.
std::string OldRevision;
std::string NewRevision;
// Information known about old revision.
Revision PriorRev;
// Information about revisions from a svn log.
std::list<Revision> Revisions;
virtual const char* LocalPath(std::string const& path);
virtual void DoRevision(Revision const& revision,
std::vector<Change> const& changes);
virtual void DoModification(PathStatus status, std::string const& path);
2017-07-20 19:35:53 +02:00
virtual bool LoadModifications() = 0;
virtual bool LoadRevisions() = 0;
2009-10-04 10:30:41 +03:00
2015-08-17 11:37:30 +02:00
virtual void WriteXMLGlobal(cmXMLWriter& xml);
void WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
2009-10-04 10:30:41 +03:00
Directory const& dir);
};
#endif