forked from MX-Linux/mx-packageinstaller
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaptcache.h
More file actions
36 lines (27 loc) · 720 Bytes
/
aptcache.h
File metadata and controls
36 lines (27 loc) · 720 Bytes
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
#ifndef APTCACHE_H
#define APTCACHE_H
#include <QFile>
#include <QHash>
#include <QMap>
#include "versionnumber.h"
// Pair of arch names returned by "uname" and corresponding DEB_BUILD_ARCH formats
static const QHash<QString, QString> arch_names {
{ "x86_64", "amd64" },
{ "i686", "i386" },
{ "armv7l", "armhf" }
};
class AptCache
{
public:
AptCache();
void loadCacheFiles();
const QMap<QString, QStringList> getCandidates();
static const QString getArch();
private:
QMap<QString, QStringList> candidates;
QString files_content;
const QString dir_name = "/var/lib/apt/lists/";
void parseContent();
bool readFile(const QString &file_name);
};
#endif // APTCACHE_H