19#ifndef FILEREVISIONS_HPP
20#define FILEREVISIONS_HPP
23#include <wx/filename.h>
30 std::vector<wxString>
vectorize(wxString fileContent);
35 wxString
diff(
const wxString& revision1,
const wxString& revisionID1,
const wxString& revision2,
const wxString& revisionID2);
36 wxString
createDiff(
const wxString& revisionContent);
40 size_t createNewTag(
const wxString& revString,
const wxString& comment);
41 void fileMove(
const wxString& newRevPath,
const wxString& comment);
50 size_t addRevision(
const wxString& revisionContent);
53 void renameFile(
const wxString& oldName,
const wxString& newName,
const wxString& newRevPath);
54 void moveFile(
const wxString& oldPath,
const wxString& newPath,
const wxString& newRevPath);
62 void restoreRevision(
const wxString& revString,
const wxString& targetFile);
64 size_t tagRevision(
size_t nRevision,
const wxString& tagComment);
65 size_t tagRevision(
const wxString& revString,
const wxString& tagComment);
wxString getRevision(size_t nRevision)
Returns the contents of the selected revision.
size_t addRevision(const wxString &revisionContent)
This method adds a new revision.
void renameFile(const wxString &oldName, const wxString &newName, const wxString &newRevPath)
This method handles renames of the corresponding file.
size_t getRevisionCount()
Returns the number of available revisions.
void restoreRevision(size_t nRevision, const wxString &targetFile)
This method will restore the contents of the selected revision.
wxArrayString getRevisionList()
This method returns a log-like list of revisions.
wxString createMerge(const wxString &diffFile)
This method merges the diff file into the current revision root.
FileRevisions(const wxString &revisionPath)
Constructor. Will try to create the missing folders on-the-fly.
size_t createNewTag(const wxString &revString, const wxString &comment)
This method creates a new tag for the passed revision.
wxString convertLineEndings(const wxString &content)
This method converts line end characters.
size_t createNewRevision(const wxString &revContent, const wxString &comment)
This method creates a new revision.
wxFileName m_revisionPath
size_t tagRevision(size_t nRevision, const wxString &tagComment)
Allows the user to tag a selected revision with the passed comment.
wxString diff(const wxString &revision1, const wxString &revisionID1, const wxString &revision2, const wxString &revisionID2)
This method calculates the differences between two files.
wxString readRevision(const wxString &revString)
This method returns the contents of the selected revision.
wxString getLastContentModification(const wxString &revString)
This method returns the last modification revision identifier.
void undoRevision()
This method removes the last added revision.
wxString compareRevisions(const wxString &rev1, const wxString &rev2)
This member function compares two revisions with each other and returns the differnces as unified dif...
wxString getLastRevisionRoot(const wxString &revString)
This method returns the revision identifier of the last revision root.
void moveFile(const wxString &oldPath, const wxString &newPath, const wxString &newRevPath)
This method handles moves of the corresponding file.
wxString readExternalFile(const wxString &filePath)
This method reads an external file into a string.
std::vector< wxString > vectorize(wxString fileContent)
Converts a single-string file into a vector of strings.
void fileMove(const wxString &newRevPath, const wxString &comment)
This method handles all file move operations.
size_t addExternalRevision(const wxString &filePath)
This method adds an external modification as new revision.
wxString createDiff(const wxString &revisionContent)
This method creates the file differences between the file contents and the current revision root.
wxString getCurrentRevision()
This method returns the revision identifier of the current revision.
size_t getMaxDiffFileSize(size_t nFileSize)
This member function returns the maximal Diff file size.