ImagingTools Core SDK
CFileProviderComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QString>
7#include <QtCore/QDir>
8
9// ACF includes
10#include <ilog/TLoggerCompWrap.h>
11#include <ifile/IFileNameParam.h>
12
13// ImtCore includes
14#include <imtfile/IFileProvider.h>
15
16
17namespace imtfile
18{
19
20
24class CFileProviderComp: virtual public IFileProvider, public ilog::CLoggerComponentBase
25{
26public:
27 typedef ilog::CLoggerComponentBase BaseClass;
28
29 I_BEGIN_COMPONENT(CFileProviderComp);
30 I_REGISTER_INTERFACE(IFileProvider);
31 I_ASSIGN(m_homeDirPathAttrPtr, "HomePath", "Home path", true, QDir::currentPath());
32 I_ASSIGN(m_pathsProblemsAutoSolveAttrPtr, "AutoSolvePathsProblems", "If 'true' servelt'll automatically solve paths problems", true, true);
33 I_ASSIGN(m_fileTemplatePathCompPtr, "FileTemplateHomePath", "FileTemplate based Home path\n Note: type is ignored only value matters \n Warning: overwrites HomePath!", false, "FileTemplatePath");
34 I_END_COMPONENT
35
36 // reimplemented (IFileProvider)
37 virtual bool LoadData(QByteArray& data, const QByteArray& name) const override;
38
39private:
40 I_ATTR (QString, m_homeDirPathAttrPtr);
41 I_ATTR (bool, m_pathsProblemsAutoSolveAttrPtr);
42 I_REF(ifile::IFileNameParam, m_fileTemplatePathCompPtr);
43};
44
45
46} // namespace imtfile
47
48
File I/O Operations and Management Module.