ACF $AcfVersion:0$
CRelativeFileNameParamComp.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
9
10
11namespace ifile
12{
13
14
16 virtual public IRelativeFilePath,
18{
19public:
21
22 I_BEGIN_COMPONENT(CRelativeFileNameParamComp);
23 I_REGISTER_INTERFACE(IRelativeFilePath);
24 I_ASSIGN(m_relativeToCompPtr, "ReferencePath", "Reference path, relative to this file or directory internal path representation will be calculated", false, "ReferencePath");
25 I_ASSIGN_TO(m_relativeToModelCompPtr, m_relativeToCompPtr, false);
26 I_END_COMPONENT;
27
29
30 // reimplemented (ifile::IRelativeFilePath)
31 virtual QString GetBasePath() const override;
32
33 // reimplemented (ifile::IFileNameParam)
34 virtual const QString& GetPath() const override;
35 virtual void SetPath(const QString& path) override;
36
37 // reimplemented (iser::ISerializable)
38 virtual bool Serialize(iser::IArchive& archive) override;
39
40protected:
41 // reimplemented (icomp::CComponentBase)
42 virtual void OnComponentCreated() override;
43 virtual void OnComponentDestroyed() override;
44
45private:
46 I_REF(ifile::IFileNameParam, m_relativeToCompPtr);
47 I_REF(imod::IModel, m_relativeToModelCompPtr);
48
49 mutable QString m_relativePath;
50
51 imod::CModelUpdateBridge m_updateBridge;
52};
53
54
55} // namespace ifile
56
57
Basic implementation of interface ifile::IFileNameParam as component.
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
virtual QString GetBasePath() const override
virtual void OnComponentCreated() override
virtual const QString & GetPath() const override
Get path.
virtual void SetPath(const QString &path) override
Set path.
virtual void OnComponentDestroyed() override
Common interface for any file system item name (e.g directory, file or URL path)
Reflects the changes of observed objects as changes of some other object (over istd::IChangeable),...
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:25
Represents an input/output persistence archive for object serialization.
Definition IArchive.h:164
Contains interfaces and implementations of file system related components.