forked from borishonman/cydownload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.h
28 lines (24 loc) · 900 Bytes
/
helpers.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
#ifndef HELPERS_H
#define HELPERS_H
#include <QString>
#include <QStandardPaths>
#include <QDir>
#include "types.h"
#define DATA_DIR QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).at(0)
#define REPO_URL_FILE "repos.ini"
#define REPO_URL_FILE_PATH QDir::cleanPath(DATA_DIR + QDir::separator() + REPO_URL_FILE)
class helpers
{
public:
static QString urlCombine(QString a, QString b);
static bool decompress(QString inFile, QString outFile);
static Package getLatestPackage(PackageVersions packageVers);
static QString bytesToHuman(qint64 sz);
static void addRepoToFile(QString url, QString file);
static void delRepoFromFile(QString url, QString file);
static int numberize (QString str);
private:
static bool decompress_bz2(QString inFile, QString outFile);
static bool decompress_gz(QString inFile, QString outFile);
};
#endif // HELPERS_H