X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fvc-backend.h;h=d487b11c7785a95ac93f878d8b0cee43df7b0d57;hb=2c832e6578ae146a2b51967cbc78cd640959f196;hp=45508ca0c25c160dd8b7b08a03f12117c99810fc;hpb=1120aa806c16aac6942760f244a1dbbe30c744be;p=lyx.git diff --git a/src/vc-backend.h b/src/vc-backend.h index 45508ca0c2..d487b11c77 100644 --- a/src/vc-backend.h +++ b/src/vc-backend.h @@ -1,21 +1,23 @@ // -*- C++ -*- /** * \file vc-backend.h - * Copyright 1995-2002 the LyX Team - * Read the file COPYING + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * * \author Lars Gullik Bjønnes + * + * Full author contact details are available in file CREDITS. */ - #ifndef VC_BACKEND_H #define VC_BACKEND_H -#ifdef __GNUG__ -#pragma interface -#endif +#include "support/filename.h" + +#include + -#include "LString.h" +namespace lyx { class Buffer; @@ -31,9 +33,9 @@ public: virtual ~VCS() {} /// register a file for version control - virtual void registrer(string const & msg) = 0; + virtual void registrer(std::string const & msg) = 0; /// check in the current revision - virtual void checkIn(string const & msg) = 0; + virtual void checkIn(std::string const & msg) = 0; /// check out for editing virtual void checkOut() = 0; /// revert current edits @@ -43,16 +45,16 @@ public: /** * getLog - read the revision log into the given file * @param fname file name to read into - */ - virtual void getLog(string const &) = 0; + */ + virtual void getLog(support::FileName const &) = 0; /// return the current version description - virtual string const versionString() const = 0; + virtual std::string const versionString() const = 0; /// return the current version - string const & version() const { - return version_; + std::string const & version() const { + return version_; } /// return the user who has locked the file - string const & locker() const { return locker_; } + std::string const & locker() const { return locker_; } /// set the owning buffer void owner(Buffer * b) { owner_ = b; } /// return the owning buffer @@ -62,32 +64,32 @@ public: protected: /// parse information from the version file virtual void scanMaster() = 0; - + /** * doVCCommand - call out to the version control utility * @param cmd the command to execute * @param path the path from which to execute * @return exit status */ - static int doVCCommand(string const & cmd, string const & path); + static int doVCCommand(std::string const & cmd, std::string const & path); - /** + /** * The master VC file. For RCS this is *,v or RCS/ *,v. master should * have full path. */ - string master_; - + support::FileName master_; + /// The status of the VC controlled file. VCStatus vcstatus; - - /** + + /** * The version of the VC file. I am not sure if this can be a - * string or if it must be a float/int. + * string or if it must be a float/int. */ - string version_; - + std::string version_; + /// The user currently keeping the lock on the VC file. - string locker_; + std::string locker_; /// The buffer using this VC Buffer * owner_; }; @@ -98,16 +100,16 @@ class RCS : public VCS { public: explicit - RCS(string const & m); + RCS(support::FileName const & m); /// return the revision file for the given file, if found - static string const find_file(string const & file); + static support::FileName const find_file(support::FileName const & file); - static void retrieve(string const & file); + static void retrieve(support::FileName const & file); - virtual void registrer(string const & msg); + virtual void registrer(std::string const & msg); - virtual void checkIn(string const & msg); + virtual void checkIn(std::string const & msg); virtual void checkOut(); @@ -115,9 +117,9 @@ public: virtual void undoLast(); - virtual void getLog(string const &); + virtual void getLog(support::FileName const &); - virtual string const versionString() const { + virtual std::string const versionString() const { return "RCS: " + version_; } @@ -131,14 +133,14 @@ class CVS : public VCS { public: /// explicit - CVS(string const & m, string const & f); + CVS(support::FileName const & m, support::FileName const & f); /// return the revision file for the given file, if found - static string const find_file(string const & file); + static support::FileName const find_file(support::FileName const & file); - virtual void registrer(string const & msg); + virtual void registrer(std::string const & msg); - virtual void checkIn(string const & msg); + virtual void checkIn(std::string const & msg); virtual void checkOut(); @@ -146,16 +148,19 @@ public: virtual void undoLast(); - virtual void getLog(string const &); + virtual void getLog(support::FileName const &); - virtual string const versionString() const { + virtual std::string const versionString() const { return "CVS: " + version_; } protected: virtual void scanMaster(); - + private: - string file_; + support::FileName file_; }; + +} // namespace lyx + #endif // VCBACKEND_H