forked from mpc-qt/mpc-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.h
More file actions
44 lines (33 loc) · 1 KB
/
storage.h
File metadata and controls
44 lines (33 loc) · 1 KB
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
#ifndef STORAGE_H
#define STORAGE_H
#include <QJsonDocument>
#include <QObject>
extern const char fileFavorites[];
extern const char fileGeometryV2[];
extern const char fileKeys[];
extern const char filePlaylists[];
extern const char filePlaylistsBackup[];
extern const char fileRecent[];
extern const char fileSettings[];
class Storage : public QObject
{
Q_OBJECT
public:
explicit Storage(QObject *parent = nullptr);
static QString fetchConfigPath();
void writeVMap(QString name, const QVariantMap &qvm);
QVariantMap readVMap(QString name);
void writeVList(QString name, const QVariantList &qvl);
QVariantList readVList(QString name);
QStringList readM3U(const QString &where);
void writeM3U(const QString &where, QStringList items);
private:
void writeJsonObject(QString fname, const QJsonDocument &doc);
QJsonDocument readJsonObject(QString fname);
signals:
public slots:
private:
static QString configPath;
QJsonDocument playlistsBackup;
};
#endif // STORAGE_H