-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomSchemeHandler.h
More file actions
41 lines (29 loc) · 986 Bytes
/
CustomSchemeHandler.h
File metadata and controls
41 lines (29 loc) · 986 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
37
38
39
40
41
#ifndef CUSTOMSCHEMEHANDLER_H
#define CUSTOMSCHEMEHANDLER_H
#include <string>
#include <iostream>
#include <memory>
#include <QFile>
#include <QTextStream>
#include <nlohmann/json.hpp>
#include "CustomScheme.h"
using json = nlohmann::json;
class CustomSchemeHandler
{
public:
static CustomSchemeHandler& getInstance() {
static CustomSchemeHandler instance;
return instance;
}
CustomSchemeHandler(CustomSchemeHandler const&) = delete;
void operator=(CustomSchemeHandler const&) = delete;
CustomScheme openCustomScheme(QString filename);
CustomScheme parseCustomScheme(std::string scheme_json_string);
void saveCustomScheme(QString filename, std::shared_ptr<CustomScheme> custom_scheme);
std::shared_ptr<CustomScheme> getCurrentCustomScheme();
void setCurrentCustomScheme(CustomScheme custom_scheme);
private:
CustomSchemeHandler() {}
std::shared_ptr<CustomScheme> current_scheme;
};
#endif // CUSTOMSCHEMEHANDLER_H