-
Notifications
You must be signed in to change notification settings - Fork 4
/
globals.h
33 lines (26 loc) · 1.04 KB
/
globals.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
#pragma once
#include <QDomDocument>
#include <QString>
#include <QJsonObject>
#include <QStringList>
#include <QPixmap>
#include <QGraphicsEffect>
#include <mutex>
typedef std::lock_guard<std::mutex> MutexLocker;
bool gfRemoveFolder(QString path);
bool gfRemoveFiles(QString dir, QString mask);
QStringList findFilesRecursively ( QStringList paths, QStringList fileTypes );
QDomDocument* gfReadXml(QString fileData);
QJsonObject gfReadJson(QString filePath);
QString gfReadFile(QString path);
void gfSaveJson(QString file, QJsonObject val);
void gfSaveJson(QString file, QJsonArray val);
void gfSaveTextFile(QString file, QString text);
QString UuidFromMd5(QString source);
QString insertUniqueSuffixedNameInList(QStringList namesAlreadyThere, QString nameToInsert, QString suffixFormat = " (%1)");
template<class T>
const T& clamp(const T& x, const T& upper, const T& lower) {
return std::min(upper, std::max(x, lower));
}
bool isSuitableForFileSystem(const QString& s);
QPixmap applyEffectToImage(QPixmap src, QGraphicsEffect *effect, int extent=0);