mirror-chatterino2/src/singletons/Paths.hpp

49 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
#include <QString>
2018-06-21 13:02:34 +02:00
#include <boost/optional.hpp>
namespace chatterino {
2018-06-28 19:51:07 +02:00
class Paths
{
2018-06-28 19:51:07 +02:00
Paths();
2018-06-13 13:27:10 +02:00
public:
2018-06-21 13:02:34 +02:00
static void initInstance();
2018-06-28 19:51:07 +02:00
static Paths *getInstance();
2018-06-13 13:27:10 +02:00
2018-06-21 13:02:34 +02:00
// Root directory for the configuration files. %APPDATA%/chatterino or ExecutablePath for
// portable mode
QString rootAppDataDirectory;
2018-06-21 13:02:34 +02:00
// Directory for settings files. Same as <appDataDirectory>/Settings
QString settingsDirectory;
2018-06-21 13:02:34 +02:00
// Directory for cache files. Same as <appDataDirectory>/Misc
QString cacheDirectory;
2018-06-21 13:02:34 +02:00
// Directory for message log files. Same as <appDataDirectory>/Misc
QString messageLogDirectory;
2018-06-21 13:02:34 +02:00
// Directory for miscellaneous files. Same as <appDataDirectory>/Misc
QString miscDirectory;
// Hash of QCoreApplication::applicationFilePath()
QString applicationFilePathHash;
2018-04-20 00:15:57 +02:00
bool createFolder(const QString &folderPath);
2018-05-28 18:25:19 +02:00
bool isPortable();
private:
2018-06-21 13:02:34 +02:00
void initAppFilePathHash();
void initCheckPortable();
void initAppDataDirectory();
void initSubDirectories();
2018-07-06 19:23:47 +02:00
static Paths *instance;
boost::optional<bool> portable_;
};
} // namespace chatterino