AusweisApp2/src/file_provider/FileProvider.h

38 lines
737 B
C
Raw Normal View History

2017-12-20 14:54:05 +01:00
/*!
* \brief Class that holds a table of the UpdatableFile instances currently in use.
*
2019-05-22 10:08:38 +02:00
* \copyright Copyright (c) 2017-2019 Governikus GmbH & Co. KG, Germany
2017-12-20 14:54:05 +01:00
*/
#pragma once
2019-01-03 15:06:22 +01:00
#include "Env.h"
2017-12-20 14:54:05 +01:00
#include "UpdatableFile.h"
#include <QHash>
2018-03-28 15:10:51 +02:00
#include <QMutex>
2017-12-20 14:54:05 +01:00
#include <QSharedPointer>
namespace governikus
{
class FileProvider
{
Q_GADGET
2019-01-03 15:06:22 +01:00
friend class Env;
2017-12-20 14:54:05 +01:00
private:
QHash<QString, QSharedPointer<UpdatableFile> > mUpdatableFiles;
2018-03-28 15:10:51 +02:00
QMutex mGetFileMutex;
2017-12-20 14:54:05 +01:00
protected:
FileProvider();
~FileProvider() = default;
2019-01-03 15:06:22 +01:00
static FileProvider& getInstance();
2017-12-20 14:54:05 +01:00
public:
const QSharedPointer<UpdatableFile> getFile(const QString& pSection, const QString& pName, const QString& pDefaultPath = QString());
};
} // namespace governikus