-
Notifications
You must be signed in to change notification settings - Fork 351
/
Copy pathkpathseaParser.h
68 lines (52 loc) · 1.42 KB
/
kpathseaParser.h
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
#ifndef Header_KPathSea_Parser
#define Header_KPathSea_Parser
#include "mostQtHeaders.h"
#include "smallUsefulFunctions.h"
#include <QThread>
#include <QSemaphore>
#include <QMutex>
#include <QQueue>
#include <set>
class PackageScanner : public SafeThread
{
Q_OBJECT
public:
void stop();
static void savePackageList(std::set<QString> packages, const QString &filename);
static std::set<QString> readPackageList(const QString &filename);
signals:
void scanCompleted(std::set<QString> packages);
protected:
explicit PackageScanner(QObject *parent = 0);
bool stopped;
};
class KpathSeaParser : public PackageScanner
{
Q_OBJECT
public:
explicit KpathSeaParser(QString kpsecmd, QObject *parent = 0, QString additionalPaths = "");
protected:
void run();
QString kpsewhich(const QString &arg);
private:
QString kpseWhichCmd;
QString m_additionalPaths;
};
class MiktexPackageScanner : public PackageScanner
{
Q_OBJECT
public:
MiktexPackageScanner(QString mpmCmd, QString settingsDir, QObject *parent = 0);
protected:
void run();
QString mpm(const QString &arg);
QString kpsewhich(const QString &arg);
void savePackageMap(const QHash<QString, QStringList> &map);
QHash<QString, QStringList> loadPackageMap();
QHash<QString, QStringList> loadMiktexPackageMap();
QStringList stysForPackage(const QString &pck);
private:
QString mpmCmd,kpseWhichCmd;
QString settingsDir;
};
#endif // LATEXSTYLEPARSER_H