-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlanguage.cpp
More file actions
95 lines (90 loc) · 2.84 KB
/
language.cpp
File metadata and controls
95 lines (90 loc) · 2.84 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include "language.h"
#include <QDebug>
// Constructor with member initializer list
Language::Language(const QString& name,
const QStringList& strings,
const QStringList& stringExtensions,
const QStringList& comments,
const QStringList& multiLineStringsStarts,
const QStringList& multiLineStringsEnds,
const QStringList& multiLineCommentsStarts,
const QStringList& multiLineCommentsEnds,
const QStringList& openIndents,
const QStringList& closeIndents,
const QStringList& closeIndentsWords,
const QStringList& defWordList,
const QStringList& fileExtensions,
const std::unordered_map<QString, int>& colorMapTS,
const int& index)
: name(name),
strings(strings),
stringExtensions(stringExtensions),
comments(comments),
multiLineStringsStart(multiLineStringsStart),
multiLineStringsEnd(multiLineStringsEnd),
multiLineCommentsStart(multiLineCommentsStart),
multiLineCommentsEnd(multiLineCommentsEnd),
openIndents(openIndents),
closeIndents(closeIndents),
closeIndentsWords(closeIndentsWords),
defWordList(defWordList),
fileExtensions(fileExtensions),
colorMapTS(colorMapTS),
index(index) {}
// Default constructor
Language::Language()
: name(""),
strings(),
stringExtensions(),
comments(),
multiLineStringsStart(),
multiLineStringsEnd(),
multiLineCommentsStart(),
multiLineCommentsEnd(),
openIndents(),
closeIndents(),
closeIndentsWords(),
defWordList(),
fileExtensions(),
colorMapTS(),
index() {}
// Copy constructor
Language::Language(const Language& other)
: name(other.name),
strings(other.strings),
stringExtensions(other.stringExtensions),
comments(other.comments),
multiLineStringsStart(other.multiLineStringsStart),
multiLineStringsEnd(other.multiLineStringsEnd),
multiLineCommentsStart(other.multiLineCommentsStart),
multiLineCommentsEnd(other.multiLineCommentsEnd),
openIndents(other.openIndents),
closeIndents(other.closeIndents),
closeIndentsWords(other.closeIndentsWords),
defWordList(other.defWordList),
fileExtensions(other.fileExtensions),
colorMapTS(other.colorMapTS),
index(other.index) {}
// Copy assignment operator
Language& Language::operator=(const Language& other) {
if (this != &other) {
name = other.name;
strings = other.strings;
stringExtensions = other.stringExtensions;
comments = other.comments;
multiLineStringsStart = other.multiLineStringsStart;
multiLineStringsEnd = other.multiLineStringsEnd;
multiLineCommentsStart = other.multiLineCommentsStart;
multiLineCommentsEnd = other.multiLineCommentsEnd;
openIndents = other.openIndents;
closeIndents = other.closeIndents;
closeIndentsWords = other.closeIndentsWords;
defWordList = other.defWordList;
fileExtensions = other.fileExtensions;
colorMapTS = other.colorMapTS;
index = other.index;
}
return *this;
}
// Destructor
Language::~Language() = default;