paths.h
#ifndef PATHS_H
#define PATHS_H
#include <QCoreApplication>
#include <QDir>
#include <QHash>
namespace OPL {
class Paths
{
public:
enum Directories {
Database,
Templates,
Backup,
Log,
Export,
};
const static inline QHash<Directories, QLatin1String> directories = {
{Database, QLatin1String("/database")},
{Templates, QLatin1String("/templates")},
{Backup, QLatin1String("/backup")},
{Log, QLatin1String("/log")},
{Export, QLatin1String("/export")},
};
Paths();
static const bool setup();
static const QDir directory(Directories location);
static const QString path(Directories location);
static const QString appDir() {return QCoreApplication::applicationDirPath();}
static const QString filePath(Directories location, const QString &filename);
static const QFileInfo databaseFileInfo();
};
} // namespace OPL
#endif // PATHS_H
OPL::Database
The DB class encapsulates the SQL database by providing fast access to hot database data.
Definition: database.h:57
OPL::Paths
Definition: paths.h:13
OPL::Paths::databaseFileInfo
static const QFileInfo databaseFileInfo()
returns a QFileInfo for the default database file.
Definition: paths.cpp:39
OPL::Paths::directory
static const QDir directory(Directories location)
Returns the QDir for the standard directory referenced by the Directories enum 'loc'.
Definition: paths.cpp:23
OPL
A namespace to collect constants and enums used throughout the application.
Definition: paths.cpp:3