1/*
2 SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: MIT
5*/
6
7#ifndef KSYNTAXHIGHLIGHTING_REPOSITORY_P_H
8#define KSYNTAXHIGHLIGHTING_REPOSITORY_P_H
9
10#include <QHash>
11#include <QList>
12#include <QMap>
13#include <QString>
14
15#include "dynamicregexpcache_p.h"
16
17namespace KSyntaxHighlighting
18{
19class Definition;
20class Repository;
21class Theme;
22
23class RepositoryPrivate
24{
25public:
26 RepositoryPrivate() = default;
27
28 static RepositoryPrivate *get(Repository *repo);
29
30 void load(Repository *repo);
31 void loadSyntaxFolder(Repository *repo, const QString &path);
32 bool loadSyntaxFolderFromIndex(Repository *repo, const QString &path);
33
34 void addDefinition(const Definition &def);
35
36 void loadThemeFolder(const QString &path);
37 void addTheme(const Theme &theme);
38
39 int foldingRegionId(const QString &defName, const QString &foldName);
40 int nextFormatId();
41
42 QList<QString> m_customSearchPaths;
43
44 // sorted map to have deterministic iteration order for e.g. definitionsForFileName
45 QMap<QString, Definition> m_defs;
46
47 // map relating all names and alternative names, case insensitively to the correct definition.
48 QMap<QString, Definition> m_fullDefs;
49
50 // this vector is sorted by translated sections/names
51 QList<Definition> m_sortedDefs;
52
53 QList<Theme> m_themes;
54
55 QHash<QPair<QString, QString>, int> m_foldingRegionIds;
56 int m_foldingRegionId = 0;
57 int m_formatId = 0;
58
59 DynamicRegexpCache m_dynamicRegexpCache;
60};
61}
62
63#endif
64

source code of syntax-highlighting/src/lib/repository_p.h