-
Notifications
You must be signed in to change notification settings - Fork 2
/
RuntimeConfigParser.h
66 lines (51 loc) · 2.23 KB
/
RuntimeConfigParser.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef RUNTIMECONFIGPARSER_H
#define RUNTIMECONFIGPARSER_H
#include <QFile>
#include <QFileInfo>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <vector>
///
/// \brief The RuntimeConfigParser class parses the runtime config file
///
class RuntimeConfigParser
{
public:
/// \brief Constructor for the RuntimeConfigParser
RuntimeConfigParser(void);
/// \brief Loads the runtime config from the given file path
/// \param pPath: The path to the runtime config
/// \return True, if the file was loaded sucessfully
bool LoadRuntimeConfig(const QString& pPath);
/// \brief Saves the runtime configto the given file path
/// \param pPath: The path to save the runtime config into
/// \return True, if the file was saved sucessfully
bool SaveRuntimeConfig(const QString& pPath);
/// \brief Returns true if the welcome dialog should be displayed on startup
/// \return True, if the welcome dialog should be displayed on startup
bool IsWelcomeDialogEnabledOnStartup(void) const;
/// \brief Setter for whether the welcome dialog should be displayed on startup
/// \param pShowOnStartup: If true, the welcome dialog will be displayed on startup
void IsWelcomeDialogEnabledOnStartup(bool pShowOnStartup);
/// \brief Getter for the list of recent files
/// \return Vector of recent files
const std::vector<QFileInfo>& GetRecentFilePaths(void) const;
/// \brief Adds a file's info to the list of recent files
/// \param pFilePath: The file info to add
void AddRecentFilePath(const QFileInfo& pFilePath);
/// \brief Tries to remove a file from the list of recent files
/// \param pFilePath: The file info to remove
void RemoveRecentFilePath(const QFileInfo &pFilePath);
/// \brief Getter for the last file path
/// \return The path of the last opened or saved file
const QString& GetLastFilePath(void) const;
/// \brief Setter for the last file path
/// \param pLastFilePath: The path of the last opened or saved file
void SetLastFilePath(const QString& pLastFilePath);
protected:
std::vector<QFileInfo> mRecentFiles;
bool mIsWelcomeDialogEnabledOnStartup;
QString mLastFilePath;
};
#endif // RUNTIMECONFIGPARSER_H