// -*- 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
-#include "LString.h"
+#include "support/filename.h"
+
+#include <string>
+
+
+namespace lyx {
class Buffer;
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
* 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 {
+ 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
/// parse information from the version file
virtual void scanMaster() = 0;
- /// reload the document
- void reload();
-
/**
* 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 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_;
};
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();
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_;
}
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();
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_;
}
virtual void scanMaster();
private:
- string file_;
+ support::FileName file_;
};
+
+} // namespace lyx
+
#endif // VCBACKEND_H