X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fvc-backend.h;h=65eccd7f25b2370fd7fffc479437a245002680cd;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=45508ca0c25c160dd8b7b08a03f12117c99810fc;hpb=1120aa806c16aac6942760f244a1dbbe30c744be;p=lyx.git diff --git a/src/vc-backend.h b/src/vc-backend.h index 45508ca0c2..65eccd7f25 100644 --- a/src/vc-backend.h +++ b/src/vc-backend.h @@ -1,21 +1,21 @@ // -*- 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 -#include "LString.h" + +namespace lyx { class Buffer; @@ -31,9 +31,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 +43,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(std::string 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 +62,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_; - + std::string 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 +98,16 @@ class RCS : public VCS { public: explicit - RCS(string const & m); + RCS(std::string const & m); /// return the revision file for the given file, if found - static string const find_file(string const & file); + static std::string const find_file(std::string const & file); - static void retrieve(string const & file); + static void retrieve(std::string 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 +115,9 @@ public: virtual void undoLast(); - virtual void getLog(string const &); + virtual void getLog(std::string const &); - virtual string const versionString() const { + virtual std::string const versionString() const { return "RCS: " + version_; } @@ -131,14 +131,14 @@ class CVS : public VCS { public: /// explicit - CVS(string const & m, string const & f); + CVS(std::string const & m, std::string const & f); /// return the revision file for the given file, if found - static string const find_file(string const & file); + static std::string const find_file(std::string 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 +146,19 @@ public: virtual void undoLast(); - virtual void getLog(string const &); + virtual void getLog(std::string const &); - virtual string const versionString() const { + virtual std::string const versionString() const { return "CVS: " + version_; } protected: virtual void scanMaster(); - + private: - string file_; + std::string file_; }; + +} // namespace lyx + #endif // VCBACKEND_H