Changeset View
Changeset View
Standalone View
Standalone View
src/lib/definition.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | Copyright (C) 2016 Volker Krause <vkrause@kde.org> | 2 | Copyright (C) 2016 Volker Krause <vkrause@kde.org> | ||
3 | Copyright (C) 2018 Christoph Cullmann <cullmann@kde.org> | ||||
3 | 4 | | |||
4 | Permission is hereby granted, free of charge, to any person obtaining | 5 | Permission is hereby granted, free of charge, to any person obtaining | ||
5 | a copy of this software and associated documentation files (the | 6 | a copy of this software and associated documentation files (the | ||
6 | "Software"), to deal in the Software without restriction, including | 7 | "Software"), to deal in the Software without restriction, including | ||
7 | without limitation the rights to use, copy, modify, merge, publish, | 8 | without limitation the rights to use, copy, modify, merge, publish, | ||
8 | distribute, sublicense, and/or sell copies of the Software, and to | 9 | distribute, sublicense, and/or sell copies of the Software, and to | ||
9 | permit persons to whom the Software is furnished to do so, subject to | 10 | permit persons to whom the Software is furnished to do so, subject to | ||
10 | the following conditions: | 11 | the following conditions: | ||
Show All 10 Lines | |||||
21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
22 | */ | 23 | */ | ||
23 | 24 | | |||
24 | #ifndef KSYNTAXHIGHLIGHTING_DEFINITION_H | 25 | #ifndef KSYNTAXHIGHLIGHTING_DEFINITION_H | ||
25 | #define KSYNTAXHIGHLIGHTING_DEFINITION_H | 26 | #define KSYNTAXHIGHLIGHTING_DEFINITION_H | ||
26 | 27 | | |||
27 | #include "ksyntaxhighlighting_export.h" | 28 | #include "ksyntaxhighlighting_export.h" | ||
28 | 29 | | |||
29 | #include <QTypeInfo> | | |||
30 | #include <QPair> | 30 | #include <QPair> | ||
31 | #include <QRegularExpression> | ||||
32 | #include <QTypeInfo> | ||||
31 | 33 | | |||
32 | #include <memory> | 34 | #include <memory> | ||
33 | 35 | | |||
34 | class QChar; | 36 | class QChar; | ||
35 | class QString; | 37 | class QString; | ||
36 | class QStringList; | 38 | class QStringList; | ||
37 | template <typename T> class QVector; | 39 | template <typename T> class QVector; | ||
38 | 40 | | |||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Line(s) | 107 | public: | |||
183 | 185 | | |||
184 | /** | 186 | /** | ||
185 | * File extensions associated with this syntax definition. | 187 | * File extensions associated with this syntax definition. | ||
186 | * The returned list contains wildcards. | 188 | * The returned list contains wildcards. | ||
187 | */ | 189 | */ | ||
188 | QVector<QString> extensions() const; | 190 | QVector<QString> extensions() const; | ||
189 | 191 | | |||
190 | /** | 192 | /** | ||
193 | * File extensions associated with this syntax definition as one regular expression. | ||||
194 | * @return file extensions as regular expression | ||||
195 | */ | ||||
196 | QRegularExpression extensionsAsRegularExpression() const; | ||||
dhaumann: @since 5.50 or 5.51 | |||||
197 | | ||||
198 | /** | ||||
199 | * Convert a vector of wildcard extensions to a regular expressions matching them all. | ||||
200 | * @param extensions extension wildcards | ||||
201 | * @return regular expression matching them | ||||
202 | */ | ||||
dhaumann: @since 5.50 or 5.51 | |||||
203 | static QRegularExpression convertExtensionsToRegularExpression(const QVector<QString> &extensions); | ||||
204 | | ||||
205 | /** | ||||
191 | * Returns the definition version. | 206 | * Returns the definition version. | ||
192 | */ | 207 | */ | ||
193 | int version() const; | 208 | int version() const; | ||
194 | 209 | | |||
195 | /** | 210 | /** | ||
196 | * Returns the definition priority. | 211 | * Returns the definition priority. | ||
197 | * A Definition with higher priority wins over Definitions with lower priorities. | 212 | * A Definition with higher priority wins over Definitions with lower priorities. | ||
198 | */ | 213 | */ | ||
▲ Show 20 Lines • Show All 198 Lines • Show Last 20 Lines |
@since 5.50 or 5.51