File: diffoperations.h

package info (click to toggle)
texstudio 2.11.2%2Bdebian-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 41,292 kB
  • ctags: 12,405
  • sloc: cpp: 93,072; xml: 10,217; ansic: 4,153; sh: 145; makefile: 56
file content (47 lines) | stat: -rw-r--r-- 985 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef DIFFOPERATIONS_H
#define DIFFOPERATIONS_H

#include "diff/diff_match_patch.h"

class QDocumentLineHandle;

class DiffOp
{

public:
	DiffOp();

	enum DiffType {
		Insert,
		Delete,
		Replace,
		Deleted,
		Inserted,
		Replaced,
		NotInserted,
		NotDeleted,
		NotReplaced
	};

	int start, length;
	DiffType type;
	QString text;
	bool lineWasModified;
	QDocumentLineHandle *dlh;
};

typedef QList<DiffOp> DiffList;
Q_DECLARE_METATYPE(DiffList)

class LatexDocument;
class QDocumentCursor;

void diffDocs(LatexDocument *doc, LatexDocument *doc2, bool dontAddLines = false);
void diffRemoveMarkers(LatexDocument *doc, bool theirs);
void diffChange(LatexDocument *doc, int ln, int col, bool theirs);
QDocumentCursor diffSearchBoundaries(LatexDocument *doc, int ln, int col, int fid, int direction = 0);
QString diffCollectText(QDocumentCursor range);
void diffChangeOpType(QDocumentCursor range, DiffOp::DiffType type);
void diffMerge(LatexDocument *doc);

#endif // DIFFOPERATIONS_H